-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Thresholded events - Quantified rate2amount (#1778)
<!--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] 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? * New `thresholded_events` generic compute and `find_events` in `run_length`. The idea is to find all runs defined by a start and a stop condition and return them along an "event" dimension. * It relies on a new function in `run_length` that can compute the run_length of sequence determined by two conditions. A first condition determines when runs should start, and a second one determines when they stop. This is called `runs_with_holes` as one possibility with the addtition of the second condition is this: consider a normal run_length, but the second condition allows for holes in thoses sequences, where those holes cannot exceed a given threshold `window_stop`. `runs_with_holes` is in fact more general, so perhaps another name should be found. * `rate2amount` and `amount2rate` can now accept Quantified (str and Quantities), which then requires passing the time coordinate in as the `dim` argument. ### Does this PR introduce a breaking change? No ### Other information: For the time being, I removed the references to "freezing rain" as I'm not sure I will need the function in xclim. If I do, then, I'll add it back.
- Loading branch information
Showing
9 changed files
with
453 additions
and
46 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
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
Oops, something went wrong.