-
Notifications
You must be signed in to change notification settings - Fork 2
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
Choose which dimensions are reduced in measures_improvement
#416
Conversation
Welcome, new contributor! It appears that this is your first Pull Request. To give credit where it's due, we ask that you add your information to the
Please make sure you've read our contributing guide. We look forward to reviewing your Pull Request shortly ✨ |
For now, I assume that if |
…ved_measure_with_dim
for more information, see https://pre-commit.ci
…sinc/xscen into improved_measure_with_dim
for more information, see https://pre-commit.ci
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.
LGTM, but I'll let @juliettelavoie approve the PR since she's a lot more familiar with this part of the code.
…sinc/xscen into improved_measure_with_dim
The current test fail is in |
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.
super!
I think the breaking changes for the nan and positional to_level
are minor enough.
FYI, The templates are here: https://github.com/Ouranosinc/xscen/tree/main/templates
the first ones uses measures_improvement
, but your changes are not breaking enough to break that script.
Pull Request Checklist:
number
) and pull request (:pull:number
) has been added.What kind of change does this PR introduce?
measures_improvement
has an extra kwarg:dim
, which allows to control on which dimensions we compute the percentage of improvement.Does this PR introduce a breaking change?
Default behaviour
None
is the same as before, reduce all dimensions. I thought it made sense to putdim
as the first kwarg, so this is not breaking per-se, but still somewhat semi-breaking for scripts inputtingto_level
positionnally e.g.measures_improvement([ds1,ds2], to_level)
, so I can move downdim
if it's preferrable.There is a small breaking change:
ds1-ds2
is used instead ofds2
to find non-null values and compute the pct of improvement. This may result in less non-null values. I think it's the right thing to do though.Other information:
My example is that I had a dataset with (rlat, rlon, period), I want improvement percentages for each period. I realize now this is an unconventional dataset in the xscen philosophy, I should have had separate dataset, when using
properties_and_measure
I should have usedperiod
etc etc. and have multiple catalog entries. But, for properties usinggroup=time.season, time.month
, we would have an extra dimensionseason, month
that we don't necessarily want to reduce, so I think it still makes sense.Also: I think this is unrelated to templates, I assumed this is related to catalogs? So I checked the box