-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Choose which dimensions are reduced in
measures_improvement
(#416)
<!-- Please ensure the PR fulfills the following requirements! --> <!-- If this is your first PR, make sure to add your details to the AUTHORS.rst! --> ### Pull Request Checklist: - [ ] This PR addresses an already opened issue (for bug fixes / features) - This PR fixes #xyz - [x] (If applicable) Documentation has been added / updated (for bug fixes / features). - [x] (If applicable) Tests have been added. - [x] This PR does not seem to break the templates. - [x] CHANGELOG.rst has been updated (with summary of main changes). - [x] Link to issue (:issue:`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 put `dim` as the first kwarg, so this is not breaking per-se, but still somewhat semi-breaking for scripts inputting `to_level` positionnally e.g. `measures_improvement([ds1,ds2], to_level)`, so I can move down `dim` if it's preferrable. There is a small breaking change: `ds1-ds2` is used instead of `ds2` 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 used `period` etc etc. and have multiple catalog entries. But, for properties using `group=time.season, time.month`, we would have an extra dimension `season, 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
- Loading branch information
Showing
8 changed files
with
67 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ Contributors | |
* Marco Braun <[email protected]> `@vindelico <https://github.com/vindelico>`_ | ||
* Sarah-Claude Bourdeau-Goulet <[email protected]> `@sarahclaude <https://github.com/sarahclaude>`_ | ||
* Blaise Gauvin St-Denis <[email protected]> `@bstdenis <https://github.com/bstdenis>`_ | ||
* Éric Dupuis <[email protected]> `@coxipi <https://github.com/coxipi>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters