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

Ouranosinc / xclim / 7227770562
90%
main: 92%

Build:
Build:
LAST BUILD BRANCH: eco-ci-project
DEFAULT BRANCH: main
Ran 15 Dec 2023 10:46PM UTC
Jobs 0
Files 0
Run time –
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

pending completion
7227770562

push

github

web-flow
Stack and unstack periods (#1558)

<!--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)
- [ ] Link to issue (:issue:`number`) and pull request (:pull:`number`)
has been added

### What kind of change does this PR introduce?

New `stack_periods` and it's reverse `unstack_periods`.

The basic idea is to have `da.rolling(time=window).construct(dim,
stride=stride)`, but with `window` and `stride` given as a multiple of a
given `freq`, allowing the use of non-uniform temporal periods (like
years or months). And to have a reverse method to go back to the linear
timeseries.

We had `sdba.construct_moving_yearly_window`, this is the generalization
of that logic for:
- other frequencies than 'YS'
- periods of different lengths (MS, QS)
- non-uniform calendars
Of course, the two latter points will generate an output where the
"fake" time axis makes no sense at all, so this is to be use with
precaution.

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

`sdba.construct_moving_yearly_window` is transparently sent to
`stack_periods` with a warning.

`sdba.unpack_moving_yearly_window` also warns and calls
`unstack_periods` but the `append_ends` argument is not available on the
latter. The behaviour is that same as `append_ends=True`.
Source Files on build 7227770562
Detailed source file information is not available for this build.
  • Back to Repo
  • 08e4ceb1 on github
  • Prev Build on master (#7226785507)
  • Next Build on master (#7358262027)
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