Skip to content

Commit

Permalink
Fix extremes n (#1413)
Browse files Browse the repository at this point in the history
<!--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
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] (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 a bit more room in the guess of number of quantiles needed.

### Does this PR introduce a breaking change?


### Other information:
* Without the extra space, ExtremesValues fails on IPSL-CM6A-LR r3i1p1f1
when trained with EMDNA. I think this because IPSL has more extremes
than EMDNA on some blocks.
  • Loading branch information
juliettelavoie committed Jul 5, 2023
2 parents 50c5d36 + 494f3c6 commit 0c2cdbc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog

v0.45.0 (unreleased)
--------------------
Contributors to this version: David Huard (:user:`huard`), Trevor James Smith (:user:`Zeitsperre`), Pascal Bourgault (:user:`aulemahal`).
Contributors to this version: David Huard (:user:`huard`), Trevor James Smith (:user:`Zeitsperre`), Pascal Bourgault (:user:`aulemahal`), Juliette Lavoie (:user: `juliettelavoie`).

New features and enhancements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -18,6 +18,7 @@ Bug fixes
Internal changes
^^^^^^^^^^^^^^^^
* Tolerance thresholds for error in ``test_stats::test_fit`` have been relaxed to allow for more variation in the results. Previously untested ``*_moving_yearly_window`` functions are now tested. (:issue:`1400`, :pull:`1402`).
* Increased the guess of number of quantiles needed in ExtremeValues. ( :pull:`1413`).

v0.44.0 (2023-06-23)
--------------------
Expand Down
2 changes: 1 addition & 1 deletion xclim/sdba/adjustment.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ def _train(
cluster_thresh = convert_units_to(cluster_thresh, ref, context="infer")

# Approximation of how many "quantiles" values we will get:
N = (1 - q_thresh) * ref.time.size
N = (1 - q_thresh) * ref.time.size * 1.05 # extra padding for safety

# ref_params: cast nan to f32 not to interfere with map_blocks dtype parsing
# ref and hist are f32, we want to have f32 in the output.
Expand Down

0 comments on commit 0c2cdbc

Please sign in to comment.