-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
fmskill/comparison.py
Outdated
title : str, optional | ||
title of the plot, by default "Taylor diagram" | ||
class SingleObsComparer(BaseComparer): | ||
def __init__(self, observation, modeldata=None): |
There was a problem hiding this comment.
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?
fmskill/comparison.py
Outdated
self._var_names = [observation.variable_name] | ||
self._itemInfos = [observation.itemInfo] | ||
|
||
if modeldata is not None: |
There was a problem hiding this comment.
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
fmskill/comparison.py
Outdated
self._var_names = [observation.variable_name] | ||
self._itemInfos = [observation.itemInfo] | ||
|
||
if modeldata is not None: |
There was a problem hiding this comment.
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
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
}
|
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. |
e.g. rename .df to .data, remove BaseComparer. All preparation for introducing new external data structure in comparer