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

Ouranosinc / xclim / 11506427990 / 6
92%
main: 92%

Build:
DEFAULT BRANCH: main
Ran 24 Oct 2024 08:03PM UTC
Files 73
Run time 4s
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

24 Oct 2024 07:50PM UTC coverage: 87.127%. Remained the same
11506427990.6

push

github

web-flow
Fix indicator outputting delta degC (#1973)

<!--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)
- [ ] (If applicable) Documentation has been added / updated (for bug
fixes / features)
- [x] 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?

Before this fix: an indicator that outputs "degC" but as a "temperature:
difference" would bug. The compute function would return a dataset with
proper units and proper "units_metadata" attribute and then the
indicator would try to convert the data to the expected units, but doing
so it would only give the units to `convert_units_to`. It would not give
the `units_metadata` attribute.

thus, `convert_units_to` was taking the compute function output and
getting "delta_degC", as expected, but then it was not able to convert
to "degC", of course.

This change passes the whole attrs to `convert_units_to` so it can
understand that the expected units are a difference.

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

We have no current indicator that output "degC" as "difference" (dtr
outputs Kelvins), but the problem would emerge in custom indicators or
with `sdba.measures.bias` where units are not explicitly set, so the
"expected ones" are inferred from the compute function's output. Before
this fix, the `units_metadata` attribute was dropped at that point,
triggering the bug described above.


### Other information:

9137 of 10487 relevant lines covered (87.13%)

0.87 hits per line

Source Files on job run-3.11-macos-latest-py311-coverage-extras - 11506427990.6
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 11506427990
  • c4e7f8cf on github
  • Prev Job for on main (#11485787478.7)
  • Next Job for on main (#11599409741.8)
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