Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparer reorganization #169

Merged
merged 10 commits into from
Feb 23, 2023
Merged

Comparer reorganization #169

merged 10 commits into from
Feb 23, 2023

Conversation

jsmariegaard
Copy link
Member

@jsmariegaard jsmariegaard commented Feb 22, 2023

e.g. rename .df to .data, remove BaseComparer. All preparation for introducing new external data structure in comparer

title : str, optional
title of the plot, by default "Taylor diagram"
class SingleObsComparer(BaseComparer):
def __init__(self, observation, modeldata=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is modeldata an optional argument? What am I supposed to compare if I dont have any modeldata?

self._var_names = [observation.variable_name]
self._itemInfos = [observation.itemInfo]

if modeldata is not None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to comment above, why should modeldata be None

self._var_names = [observation.variable_name]
self._itemInfos = [observation.itemInfo]

if modeldata is not None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to comment above, why should modeldata be None

@ecomodeller
Copy link
Member

I think it is time to re-evaluate this inheritance structure and check if it all relationships makes sense.

---
title: Comparers
---
classDiagram
    
    BaseComparer <|-- SingleObsComparer
   SingleObsComparer <|--  PointComparer
   SingleObsComparer <|--  TrackComparer
   BaseComparer <|-- ComparerCollection

class BaseComparer{
+skill()
+scatter()
+sel_df()
}

class SingleObsComparer{
+float x 
+float y
+score()
+taylor()
+hist()
+remove_bias()
+copy()
}

class ComparerCollection{
+score()
+hist()
+mean_skill()
+mean_skill_points()
+taylor()
+copy()
+add_comparer()
}

class PointComparer{
+plot_timeseries()
}

class TrackComparer{
+float[] x
+float[] y
}
Loading

@jsmariegaard
Copy link
Member Author

Agree - this is also what I am working towards: to have a simplified structure most likely with just two classes: SingleObsComparer and ComparerCollection with no inheritance structure. The first should have an xarray structure "data" that completely defines it. The second should be a dictionary-like structure that holds a number of these Comparers.

@jsmariegaard jsmariegaard changed the title Comparer: rename .df to .data Comparer reorganization Feb 23, 2023
@jsmariegaard jsmariegaard merged commit df34ad1 into main Feb 23, 2023
@jsmariegaard jsmariegaard deleted the Comparer-rename-data branch February 23, 2023 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants