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

Ouranosinc / xclim / 22311596568
92%

Build:
DEFAULT BRANCH: main
Ran 23 Feb 2026 03:04PM UTC
Jobs 6
Files 60
Run time 1min
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 Feb 2026 02:59PM UTC coverage: 91.882%. First build
22311596568

push

github

web-flow
Flexible handling of zero-precipitation probabilities in standardized precipitation index (#2280)

<!--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 #2279
- [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] 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?

Adds a new argument `prob_zero_method` to `standardized_index` and
`standardized_precipitation_index`. This argument allows users to
control how the probability of zero-precipitation events ($P(x=0)$) is
handled when transforming to the standard normal distribution.

Supported options are:
* "center" (Default): Uses the Center of Mass method ($P = p_0 / 2$) as
recommended by Stagge et al. (2015) to avoid bias in the mean SPI.
* "upper": Uses the traditional cumulative probability ($P = p_0$),
which replicates the legacy behavior (McKee method).
* Callable: Accepts a custom function (e.g., lambda p: p * 0.75) for
experimental use cases.

### Does this PR introduce a breaking change?

No.

While the default calculation method has changed from the implicit
"upper" method to the unbiased "center" method. The API remains backward
compatible, and users who strictly require the old values can set
prob_zero_method="upper".

24 of 36 new or added lines in 1 file covered. (66.67%)

7934 of 8635 relevant lines covered (91.88%)

6.27 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
12
88.62
src/xclim/indices/stats.py
Jobs
ID Job ID Ran Files Coverage
1 run-3.14-ubuntu-latest- - 22311596568.1 23 Feb 2026 03:04PM UTC 60
88.01
GitHub Action Run
2 run-{{ matrix.python-version }}-conda - 22311596568.2 23 Feb 2026 03:06PM UTC 60
91.46
GitHub Action Run
3 run-3.10-ubuntu-latest- - 22311596568.3 23 Feb 2026 03:05PM UTC 60
88.03
GitHub Action Run
4 run-3.13-ubuntu-latest- - 22311596568.4 23 Feb 2026 03:05PM UTC 60
88.01
GitHub Action Run
5 run-3.13-macos-latest- - 22311596568.5 23 Feb 2026 03:08PM UTC 60
91.08
GitHub Action Run
6 run-3.12-ubuntu-latest- - 22311596568.6 23 Feb 2026 03:08PM UTC 60
88.7
GitHub Action Run
Source Files on build 22311596568
  • Tree
  • List 60
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #22311596568
  • 18b70d30 on github
  • Prev Build on main (#22116133377)
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