Refactoring climpred to use classes under the hood
Many of the function signatures are the same; it might be good to use class inheritance to solve that.
Here's an outline:
Comparisons():
__init__:
forecasts
references
Alignment(Comparisons):
__init__:
alignment
Scoring(Alignment):
__init__:
metrics
comparisons
dimensions
HindcastScoring(Scoring):
function
self.forecasts
self.references
self.alignment
self.metrics
self.comparisons
self.dimensions
PersistenceScoring(Scoring):
function
self.forecasts
self.references
self.alignment
self.metrics
self.comparisons
self.dimensions
UninitializedScoring(Scoring):
function
self.forecasts
self.references
self.alignment
self.metrics
self.comparisons
self.dimensions
Bootstrap(Scoring):
__init__:
resample_dimemsion
significance_level
PerfectModelBootstrap(Bootstrap):
function
self.forecasts
self.references
self.alignment
self.metrics
self.comparisons
self.dimensions
self.resample_dimension
self.significance_level
HindcastBootstrap(Bootstrap):
function
self.forecasts
self.references
self.alignment
self.metrics
self.comparisons
self.dimensions
self.resample_dimension
self.significance_level
Items under __init__ are the necessary keyword arguments to inherit from that class, items under function are inherited arguments. Feel free to question/comment/suggest!
I think it would helpful to talk about this over a video call. It looks really nice and organized but it'd help to hear you walk us through it! Are you free for something like that anytime soon?
VerifyPerfectModel(Scoring)
VerifyHindcast(Scoring)
I think these still go under HindcastEnsemble. Right @ahuang11? They would use these other classes from his outline.
VerifyPerfectModel(Scoring) VerifyHindcast(Scoring)
More here https://github.com/bradyrx/climpred_skeleton
Still continuing on this front. We've prioritized getting the JOSS paper submitted with the current version. I'm also reviewing and patching ideas on xskillscore and climpred, which is pulling from my time on this problem. I'd say climpred_skeleton is about 2/3rds of the way there. Then the project of revamping this code is big. Will likely create a branch called e.g. classify_climpred and then do little edits to that as I build up the code base so it is easily reviewable.
for discussion about API in with bootstrapping see #375