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

Ouranosinc / xclim / 15164396745
92%

Build:
DEFAULT BRANCH: main
Ran 21 May 2025 02:11PM 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
15164396745

push

github

web-flow
Support DataTree (#2144)

<!--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 #2127
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] (If applicable) Documentation has been added / updated (for bug
fixes / features)
- [ ] CHANGELOG.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?

Support `xarray.Datatree` objects in the `ds` argument of indicators.
When receiving such an object, the indicator computation is mapped over
the datasets of the tree.

Passing a `Datatree` implies setting the `as_dataset` option to True.

### Does this PR introduce a breaking change?
No, it shouldn't. `xr.Datatree` was added recently, and xclim will not
fail if it absent. However, I can't promise it will work with the old
standalone `xarray-datatree` module!


### Other information:
This is missing some tests, but most importantly I have a dilemma here :
what do we do when a node doesn't have the appropriate variables ?

A Datatree can have nodes with no data, I think it is quite common,
depending on your structure. Currently, the code will skip any node that
has no "data vars", returning the node untouched. However, any other
node that doesn't have the required variables will trigger a failure
with a `MissingVariableError`.

Alternatives would be to return an empty node or return the node
untouched.

What does @kobebryant432 think of this question ?
Source Files on build 15164396745
Detailed source file information is not available for this build.
  • Back to Repo
  • d2299f61 on github
  • Prev Build on main (#15139673243)
  • Next Build on main (#15189939460)
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