question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refactoring climpred to use classes under the hood

See original GitHub issue

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!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
aaronspringcommented, Sep 30, 2020

for discussion about API in with bootstrapping see #375

1reaction
bradyrxcommented, Sep 5, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

climpred
PerfectModelEnsemble and HindcastEnsemble classes to make ... can be called directly in climpred, we suggest that you use our classes ( ...
Read more >
climpred: verification of weather and climate forecasts ...
In our past coding journey, collaborative coding, feedbacking issues and pull requests advanced our code and thinking about forecast verification more than we ......
Read more >
climpred: verification of weather and climate forecasts
In our past coding journey, collaborative coding, feedbacking issues and pull requests advanced our code and thinking about forecast verification more than we ......
Read more >
Reference Forecasts — climpred documentation
In climpred , we use uninitialized ensembles as a baseline for how important (reoccurring) initializations are for lending predictability to ...
Read more >
Verification Alignment — climpred documentation
"same_inits" : Use a common set of initializations that verify across all leads. This ensures that there is no bias in the result...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found