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

Ouranosinc / xclim / 45880692660
90%

Build:
DEFAULT BRANCH: main
Ran 26 Nov 2026 07:07PM UTC
Jobs 8
Files 63
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

26 Nov 2026 07:03PM UTC coverage: 90.478% (-0.009%) from 90.487%
45880692660

push

github

web-flow
Fix array copying issue with upstream xarray (#2483)

### Pull Request Checklist:
- [x] This PR addresses an already opened issue
    - This PR fixes #2390
- [x] Tests for the relevant changes have been added to this PR
- [x] Documentation has been added / updated
- [x] CHANGELOG.rst has been updated (with a short summary of the main
changes)
- [x] Links to issue (:issue:`number`) and pull request (:pull:`number`)
have been added

### What kind of change does this PR introduce?
Down in the subfunctions of `xclim.core.utils.calc_perc`, `copy=False`
is ignored if the input array is read-only, instead of raising an error.

The error we were getting was because of this change in xarray :
pydata/xarray#11688. However, this means we were doing something wrong!

The idea behind `percentile_doy`'s `copy` arg is to allow the
`calc_perc` function to mutate the input (`copy=False`) instead of
copying it, saving time. It was True by default, probably because it was
assumed that none of the operations done before `calc_perc` were
copying, so it needed `calc_perc` to copy to avoid mutating the actual
input.

However, this was not true. Prior to the xarray PR linked above, the
stack-unstack line was copying the array anyway. Thus, the input to
`calc_perc` was a copy with no other references, so it was safe not to
copy it again.
With the PR, the stack-unstack now returns a read-only view in certain
cases, which makes copying necessary anyway.

So, I removed the argument from `percentile_doy` and we now pass
`copy=False` to `calc_perc`, which is now ignored anyway when a
read-only array is given.

### Does this PR introduce a breaking change?
An argument has been deprecated. For now a warning is emitted and the
argument does nothing. We could remove it in a future release.


### Other information
@abel-bzz @MH0UD Tagging you to make you aware of this change. This
`copy=False` possibility was added in the context of bootstrapping, it
might impact icclim.

2 of 3 new or added lines in 2 files covered. (66.67%)

8248 of 9116 relevant lines covered (90.48%)

7.63 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
92.5
-0.15% src/xclim/core/calendar.py
Jobs
ID Job ID Ran Files Coverage
1 run-3.12-ubuntu-latest-offline - 45880692660.1 26 Nov 2026 07:16PM UTC 63
89.16
GitHub Action Run
2 run-{{ matrix.python-version }}-conda - 45880692660.2 26 Nov 2026 07:07PM UTC 63
89.75
GitHub Action Run
3 run-3.13-windows-latest-prefetch - 45880692660.3 26 Nov 2026 07:12PM UTC 63
88.96
GitHub Action Run
4 run-3.13-macos-latest- - 45880692660.4 26 Nov 2026 07:12PM UTC 63
89.74
GitHub Action Run
5 run-3.14-ubuntu-latest- - 45880692660.5 26 Nov 2026 07:09PM UTC 63
86.29
GitHub Action Run
6 run-3.13-ubuntu-latest- - 45880692660.6 26 Nov 2026 07:08PM UTC 63
86.85
GitHub Action Run
7 run-3.12-ubuntu-latest- - 45880692660.7 26 Nov 2026 07:08PM UTC 63
86.3
GitHub Action Run
8 run-3.12-ubuntu-latest-doctests - 45880692660.8 26 Nov 2026 07:07PM UTC 63
55.75
GitHub Action Run
Source Files on build 45880692660
  • Tree
  • List 63
  • Changed 4
  • Source Changed 4
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #45880692660
  • c3d63a83 on github
  • Prev Build on main (#45702715480)
  • Next Build on main (#45885871112)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc