Skip to content

Commit

Permalink
Disable upstream numpy until numba supports it, use raw.githubusercon…
Browse files Browse the repository at this point in the history
…tent (#1961)

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

* Disables the installation of `numpy@main` until `numba` supports it
* Testing data fetching now uses the `raw.githubusercontent.com` URL 

### Does this PR introduce a breaking change?

No.
  • Loading branch information
Zeitsperre authored Oct 17, 2024
2 parents 3d0b1ba + 43d6787 commit e0e6331
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ Internal changes
* Adjusted `mypy` checks to be more standardized.
* Renamed annual deprecated frequency alias `"A"` to `"Y"` (:pull:`1930`).
* The ``indices`` documentation now includes the members of ``xclim.indices.stats``. (:issue:`1913`, :pull:`1958`).
* The default URL for fetching testing data is now set to the ``raw.githubusercontent.com`` mirror of `xclim-testdata`. (:pull:`1961`).
* The ``upstream`` `tox` environment has been updated to not install the latest `numpy` until `numba` supports it. (:pull:`1961`).

CI changes
^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion CI/requirements_upstream.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bottleneck @ git+https://github.com/pydata/bottleneck.git@master
cftime @ git+https://github.com/Unidata/cftime.git@master
flox @ git+https://github.com/xarray-contrib/flox.git@main
numpy @ git+https://github.com/numpy/numpy.git@main
# numpy @ git+https://github.com/numpy/numpy.git@main
xarray @ git+https://github.com/pydata/xarray.git@main
2 changes: 2 additions & 0 deletions tests/test_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ class TestStandardizedIndices:
# Repeated tests with lower tolerance means we want a more precise comparison, so we compare
# the current version of XClim with the version where the test was implemented
@pytest.mark.slow
@pytest.mark.filterwarnings("ignore:dt.weekofyear and dt.week have been deprecated")
@pytest.mark.parametrize(
"freq, window, dist, method, values, diff_tol",
[
Expand Down Expand Up @@ -2227,6 +2228,7 @@ def test_static_freeze_thaw_cycles(self, tasmin_series, tasmax_series):


class TestTemperatureSeasonality:

def test_simple(self, tas_series):
a = np.zeros(365)
a = tas_series(a + K2C, start="1971-01-01")
Expand Down
8 changes: 5 additions & 3 deletions xclim/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@
default_testdata_version = "v2024.8.23"
"""Default version of the testing data to use when fetching datasets."""

default_testdata_repo_url = "https://github.com/Ouranosinc/xclim-testdata"
default_testdata_repo_url = (
"https://raw.githubusercontent.com/Ouranosinc/xclim-testdata/"
)
"""Default URL of the testing data repository to use when fetching datasets."""

try:
Expand Down Expand Up @@ -433,7 +435,7 @@ def load_registry(
dict
Dictionary of filenames and hashes.
"""
remote_registry = audit_url(f"{repo}/raw/{branch}/data/registry.txt")
remote_registry = audit_url(f"{repo}/{branch}/data/registry.txt")

if branch != default_testdata_version:
custom_registry_folder = Path(
Expand Down Expand Up @@ -510,7 +512,7 @@ def nimbus( # noqa: PR01
"You can install it with `pip install pooch` or `pip install xclim[dev]`."
)

remote = audit_url(f"{repo}/raw/{branch}/data")
remote = audit_url(f"{repo}/{branch}/data")
return pooch.create(
path=cache_dir,
base_url=remote,
Expand Down

0 comments on commit e0e6331

Please sign in to comment.