-
Notifications
You must be signed in to change notification settings - Fork 0
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
add partition plot #134
add partition plot #134
Conversation
for more information, see https://pre-commit.ci
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
<!--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: - [x] This PR addresses an already opened issue (for bug fixes / features) - This PR fixes #1497 - [x] Tests for the changes have been added (for bug fixes / features) - [x] (If applicable) Documentation has been added / updated (for bug fixes / features) - [x] CHANGES.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? * Add partition algo from Lafferty and Sriver (2023) ### Does this PR introduce a breaking change? depends (see options below) ### Other information: TODO list in this PR: - [x] Add weights - [x] add tests - [x] Maybe add `num` to `hawkins_sutton` ? - [x] Clean up based on changes outside of this PR (eg. remove functions that are now elsewhere) TODO list outside of this PR: - [ ] Add a more general `graph_fraction_of_total_variance` to figanos (in progress by Juliette, Ouranosinc/figanos#134) - [ ] Add a function in xscen to prepare the data from a catalog. (Ouranosinc/xscen#289) In this function, I could rename the dimension to fit what the partition vocabulary (`model`, `scenario`, `downscaling`) OR we could change the partition vocab to the catalog/xscen vocab (`source`, `experiment`, `bias_adjust_project`). Option 2 is my personal preference, but that would be a breaking change for `hawkins_sutton`.
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.
Ben beau. Question: qu'est-ce que je fais avec la PR originale #9 ?
Il y a dedans d'autres types de graphiques qu'on retrouve dans H&S ?
Vite de même, je ne suis pas sur de voir l'utilité de mettre Pour |
Co-authored-by: David Huard <[email protected]>
C'est des détails, mais en changeant la linewidth il y a un dédoublement vers le bas et en zoomant on peut voir que la couleur orange dépasse de la ligne. Dans l'exemple du notebook, qu'est-ce que représente "total" avec la couleur "k" dans "fill_kw"? |
linewidth: Je pense que c'est un bug de matplotlib parce que c'est le bas du fill_width= black lines. Je peux ajouter dans le docstring qu'on recommande lw>=2 ? |
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.
<!-- 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] HISTORY.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? * Add `xs.ensembles.get_partition_input` to prepare data from catalog to be passed to xclim partionning functions (https://xclim.readthedocs.io/en/stable/api.html#uncertainty-partitioning) * Now, I am wondering if it would be more xscen to also wrap the xclim fonction instead only prepping the data? This would allow to add a attrs `processing_level= partition` to be able to put it in a a catalog. workflow 1: `xs.get_partition_input` -> `xc.ensembles.lafferty_sriver` -> `fg.partition` workflow 2: `xs.partition` (which gets the input and wraps xclim) -> maybe save to disk and catalog -> `fg.partition` or other plots (maybe maps of one component) EDIT: I went with workflow 1 ### Does this PR introduce a breaking change? no ### Other information: * I wasn't sure if this should be in `extract.py` (because we extract from a cat) or in `ensembles.py` ( to match the xclim module). * companion de Ouranosinc/xclim#1529 et Ouranosinc/figanos#134
Pull Request Checklist:
number
) and pull request (:pull:number
) has been added.What kind of change does this PR introduce?
Does this PR introduce a breaking change?
no
Other information:
Companion de Ouranosinc/xclim#1529
TODO: