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

Ouranosinc / xclim / 12875104937
92%

Build:
DEFAULT BRANCH: main
Ran 20 Jan 2025 08:22PM UTC
Jobs 8
Files 72
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

20 Jan 2025 08:15PM UTC coverage: 89.974% (+0.04%) from 89.934%
12875104937

push

github

web-flow
Clean and export the units registry (#2040)

### What kind of change does this PR introduce?
* Remove support for non-CF aliases : "cms" (m3 s-1), "mmday" (mm d-1)
and "pct" (%). These are not supported by `udunits2` and thus I don't
see why we should support them ? @huard, @RondeauG what do you think ?
I'm not strongly opinionated on this.

* Set the unit registry as pint's "application registry" to make it
usable by non-xclim aware applications. To be obtained with `ureg =
pint.get_application_registry()`.

* Units of quantities printed in indicator attributes are now formatted
using the CF syntax (ex: "mm d-1" instead of "mm/d"). Not sure how I
missed that earlier...

* Clean up in the code of the registry declaration and addition of
comments to explain what is happening.

* A small change in `dataflags` that was actually unneeded at the end,
but it felt cleaner to me, so I kept it.

### Does this PR introduce a breaking change?
Some units are not supported anymore (`cms`, `pct` and `mmday`).
Some attributes will be different as the units are printed differently
(for fractions mostly).

### Other information:
The registry export allows an application/module that is units-agnostic
in itself, to be used with xclim. For those applications / usages, the
import order might be significant though : `xclim` has to be the last
`set_application_registry` done. Specifically in the climate case, as
`xclim.core.units` imports `cf_xarray.units` (which also sets the app
registry), a subsequent `import cf_xarray.units` is not problematic as
python will _not_ actually execute it.

11 of 11 new or added lines in 6 files covered. (100.0%)

9522 of 10583 relevant lines covered (89.97%)

7.62 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.12-ubuntu-latest-standard - 12875104937.1 20 Jan 2025 08:26PM UTC 72
82.7
GitHub Action Run
2 run-3.10-ubuntu-latest-preliminary - 12875104937.2 20 Jan 2025 08:26PM UTC 72
82.35
GitHub Action Run
3 run-3.10-windows-latest-py310-coverage-prefetch - 12875104937.3 20 Jan 2025 08:26PM UTC 72
82.16
GitHub Action Run
4 run-3.11-ubuntu-latest-py311-coverage-sbck-offline-prefetch - 12875104937.4 20 Jan 2025 08:26PM UTC 72
84.18
GitHub Action Run
5 run-{{ matrix.python-version }}-conda - 12875104937.5 20 Jan 2025 08:26PM UTC 72
88.13
GitHub Action Run
6 run-3.10-ubuntu-latest-standard - 12875104937.6 20 Jan 2025 08:26PM UTC 72
82.35
GitHub Action Run
7 run-3.11-macos-latest-py311-coverage-extras - 12875104937.7 20 Jan 2025 08:26PM UTC 72
88.1
GitHub Action Run
8 run-3.11-ubuntu-latest-standard - 12875104937.8 20 Jan 2025 08:26PM UTC 72
84.24
GitHub Action Run
Source Files on build 12875104937
  • Tree
  • List 72
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 2bf86068 on github
  • Prev Build on main (#12872165263)
  • Next Build on main (#12952387084)
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

© 2025 Coveralls, Inc