• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Ouranosinc / xclim / 6617734176
90%
main: 92%

Build:
Build:
LAST BUILD BRANCH: eco-ci-project
DEFAULT BRANCH: main
Ran 23 Oct 2023 07:05PM UTC
Jobs 2
Files 70
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Oct 2023 06:55PM UTC coverage: 90.555% (-0.001%) from 90.556%
6617734176

push

github

web-flow
Improve SPI performance (#1311)

<!--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 #1270 and fixes #1416 and fixes #1474
- [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] 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?

* Make SPI/SPEI faster
* fit params are now modular, can be computed before computing SPI/SPEI.
This allows more options to segment computations and allow to obtain the
fitting params if troubleshooting is needed.
* time indexing now possible
* `dist_method` now avoids `vectorize=True` in its `xr.apply_ufunc`.
This is the main improvement in SPI/SPEI.
* Better document the limits of usage of standardized indices. Now
standardized indices are capped at extreme values ±8.21. The upper bound
is a limit resulting of the use of float64.

### Does this PR introduce a breaking change?
Yes.

* `pr_cal` or `wb_cal` will not be input options in the future: 

> Inputing `pr_cal` will be deprecated in xclim==0.46.0. If `pr_cal` is
a subset of `pr`, then instead of:

`standardized_precipitation_index(pr=pr,pr_cal=pr.sel(time=slice(t0,t1)),...)`,
one can call:
`standardized_precipitation_index(pr=pr,cal_range=(t0,t1),...)`.
If for some reason `pr_cal` is not a subset of `pr`, then the following
approach will still be possible:
`params = standardized_index_fit_params(da=pr_cal, freq=freq,
window=window, dist=dist, method=method)`.
`spi = standardized_precipitation_index(pr=pr, params=params)`.
This approach can be used in both sce... (continued)

79 of 92 new or added lines in 2 files covered. (85.87%)

1 existing line in 1 file now uncovered.

8485 of 9370 relevant lines covered (90.55%)

4.37 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-{{ matrix.tox-env }} - 6617734176.1 23 Oct 2023 07:09PM UTC 0
90.55
2 run-{{ matrix.tox-env }}-opt-slow - 6617734176.2 23 Oct 2023 07:09PM UTC 0
90.1
Source Files on build 6617734176
Detailed source file information is not available for this build.
  • Back to Repo
  • dae1ffdc on github
  • Prev Build on master (#6614076758)
  • Next Build on master (#6628058676)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc