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

Ouranosinc / xclim / 14888847601
92%

Build:
DEFAULT BRANCH: main
Ran 07 May 2025 04:55PM UTC
Jobs 8
Files 59
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

07 May 2025 04:51PM UTC coverage: 92.367% (+0.1%) from 92.268%
14888847601

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)

11 of 14 new or added lines in 2 files covered. (78.57%)

3 existing lines in 1 file now uncovered.

7539 of 8162 relevant lines covered (92.37%)

8.09 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
3
79.84
3.61% src/xclim/testing/utils.py

Uncovered Existing Lines

Lines Coverage ∆ File
3
89.49
-1.02% src/xclim/core/utils.py
Jobs
ID Job ID Ran Files Coverage
1 run-3.11-ubuntu-latest-py311-coverage-extras-sbck-offline-prefetch - 14888847601.1 07 May 2025 04:59PM UTC 59
88.79
GitHub Action Run
2 run-{{ matrix.python-version }}-conda - 14888847601.2 07 May 2025 04:59PM UTC 58
92.23
GitHub Action Run
3 run-3.11-macos-latest-py311-coverage-extras-lmoments - 14888847601.3 07 May 2025 04:59PM UTC 59
92.18
GitHub Action Run
4 run-3.12-ubuntu-latest-standard - 14888847601.4 07 May 2025 04:59PM UTC 59
88.85
GitHub Action Run
5 run-3.12-windows-latest-py312-coverage-prefetch - 14888847601.5 07 May 2025 04:59PM UTC 59
88.35
GitHub Action Run
6 run-3.11-ubuntu-latest-preliminary - 14888847601.6 07 May 2025 04:59PM UTC 59
88.62
GitHub Action Run
7 run-3.11-ubuntu-latest-standard - 14888847601.7 07 May 2025 04:59PM UTC 59
88.92
GitHub Action Run
8 run-3.10-ubuntu-latest-standard - 14888847601.8 07 May 2025 04:59PM UTC 59
88.85
GitHub Action Run
Source Files on build 14888847601
  • Tree
  • List 59
  • Changed 5
  • Source Changed 5
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 1feb36a7 on github
  • Prev Build on main (#14886240106)
  • Next Build on main (#14972283644)
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