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

Ouranosinc / xclim / 14888847601 / 4
92%
main: 92%

Build:
DEFAULT BRANCH: main
Ran 07 May 2025 04:59PM UTC
Files 59
Run time 2s
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

07 May 2025 04:51PM UTC coverage: 88.851% (+0.09%) from 88.763%
14888847601.4

push

github

web-flow
Removed deprecated functions, deprecate `testing.open_dataset` (#2139)

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

* Removes the deprecated `sfcwind_2_uas_vas` and `uas_vas_2_sfcwind`
converter functions.
* Adds a deprecation notice to `xclim.testing.open_dataset` to be
removed in a future version
* Changes the signature of `xclim.testing.helpers.generate_atmos` to
only accept a `nimbus` object.
* Fixes a bug that was causing cache directories to store generated
files in a directory that duplicated the version string (e.g.
`XDG_CACHE_DIR/xclim-testdata/v2077.1.1/v2077.1.1`).

### Does this PR introduce a breaking change?

Yes. Functions that were previously deprecated have been removed.
Suggestions have been made to use the `nimbus` class to manage fetching
testing data.

When opening either an absolute path location on disk or an OPeNDAP
link, developers are expected to use the typical
`xarray.open_{mf}dataset()` function. Paths provided by `nimbus.fetch()`
will always be absolute paths.

### Other information

This change moves most of the xclim-testdata fetching mechanism to rely
on `pooch.Pooch` as that object is much better at handling caching and
versioning.

It is very important to never use `nimbus.fetch()` on a `pathlib.Path`
object. The `registry` of a `Pooch` object is synonymous with a
dictionary, and some issues that needed to be dealt with stemmed from
that misusage.

An example of what this does for Windows:
```python

# Actual file is "NRCANdaily/nrcan_canada_daily_tasmax_1990.nc" in registry

file = Path("NRCANdaily", "nrcan_canada_daily_tasmax_1990.nc")
xr.open_dataset(nimbus.fetch(file))

>>> ValueError: File 'NRCANdaily\nrcan_canada_daily_tasmax_1990.nc' is not in the registry.
```

### Tiniest caveat

In order to support `no external sockets` mode, I needed to slightly the
internal `_fetch` method of `nimbus`:

```python
try:
    return _nimbus.fetch_diversion(*args, **kwargs)
except SocketBlockedError as err:
    raise File... (continued)

7252 of 8162 relevant lines covered (88.85%)

0.89 hits per line

Source Files on job run-3.12-ubuntu-latest-standard - 14888847601.4
  • Tree
  • List 59
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 14888847601
  • 1feb36a7 on github
  • Prev Job for on main (#14886240106.6)
  • Next Job for on main (#14972283644.3)
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