-
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
Create ComparerCollection in init #320
Conversation
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.
Great stuff - ready for merge IMO, but if you like it would also be great if it could take a list of names
modelskill/comparison/_collection.py
Outdated
@@ -235,18 +214,36 @@ def __repr__(self): | |||
out.append(f"{type(value).__name__}: {key}") | |||
return str.join("\n", out) | |||
|
|||
def __getitem__(self, x) -> Comparer: | |||
@overload | |||
def __getitem__(self, x: slice) -> ComparerCollection: |
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.
It says slice, but can I also provide a list of names? e.g. cc[["stn3", "stn1"]] ? (like pandas or xarray)
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.
no, not yet
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.
Instead of creating an empy ComparerCollection and then inserting Comparers in it.