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

Ouranosinc / xclim / 11506427990
92%

Build:
DEFAULT BRANCH: main
Ran 24 Oct 2024 07:58PM UTC
Jobs 8
Files 73
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

24 Oct 2024 07:50PM UTC coverage: 89.377%. Remained the same
11506427990

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:

9373 of 10487 relevant lines covered (89.38%)

7.55 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.12-ubuntu-latest-standard - 11506427990.1 24 Oct 2024 08:03PM UTC 73
81.69
GitHub Action Run
2 run-3.11-ubuntu-latest-standard - 11506427990.2 24 Oct 2024 08:03PM UTC 73
83.57
GitHub Action Run
3 run-{{ matrix.python-version }}-conda - 11506427990.3 24 Oct 2024 08:03PM UTC 73
87.17
GitHub Action Run
4 run-3.10-ubuntu-latest-standard - 11506427990.4 24 Oct 2024 08:03PM UTC 73
81.66
GitHub Action Run
5 run-3.10-windows-latest-py310-coverage-prefetch - 11506427990.5 24 Oct 2024 08:03PM UTC 73
81.5
GitHub Action Run
6 run-3.11-macos-latest-py311-coverage-extras - 11506427990.6 24 Oct 2024 08:03PM UTC 73
87.13
GitHub Action Run
7 11506427990.7 24 Oct 2024 08:03PM UTC 73
81.66
GitHub Action Run
8 run-3.11-ubuntu-latest-py311-coverage-sbck-offline-prefetch - 11506427990.8 24 Oct 2024 08:03PM UTC 73
83.54
GitHub Action Run
Source Files on build 11506427990
  • Tree
  • List 73
  • Changed 71
  • Source Changed 0
  • Coverage Changed 24
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • c4e7f8cf on github
  • Prev Build on main (#11485787478)
  • Next Build on main (#11599409741)
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