Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ repos:
- id: rst-inline-touching-normal
- id: text-unicode-replacement-char
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.7
rev: v0.14.9
hooks:
- id: ruff-check
args: [ '--fix', '--show-fixes' ]
Expand Down Expand Up @@ -87,12 +87,12 @@ repos:
additional_dependencies: [ 'tomli' ]
args: [ '--toml=pyproject.toml' ]
- repo: https://github.com/numpy/numpydoc
rev: v1.9.0
rev: v1.10.0
hooks:
- id: numpydoc-validation
exclude: "^docs/|^tests/"
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.35.0
rev: 0.36.0
hooks:
- id: check-github-workflows
- id: check-readthedocs
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Internal changes
* Removed `black`, `blackdoc`, and `isort`, as well as their configurations.
* Updated `pyproject.toml` to be `PEP 639 <https://peps.python.org/pep-0639>`_-compliant.
* Pinned `pydantic` below v2.12 due to breaking changes in their API. (PR #548)
* Unpinned `pydantic` as newer 2.12 patch releases appear to have addressed regressions. (PR #559).
* Pinned `pydap` >=3.5.6 and `h5netcdf` >=1.5.0 to ensure modern versions with better `xarray` support are installed by default. (PR #559).

.. _changes_0.19.1:

Expand Down
5 changes: 3 additions & 2 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ dependencies:
- owslib >=0.29.1
- pandas >=2.2.0
- pint >=0.24.4
- pydantic >=2.11,<2.12
- pydap >=3.4.0,<3.5.5 # pydap 3.5.5 is not currently supported by `xarray` (v2025.3.1)
- pydantic >=2.11
- pydap >=3.5.6
- pymetalink >=6.5.2
- pymbolic >=2024.2
- pyproj >=3.3.0
Expand Down Expand Up @@ -53,6 +53,7 @@ dependencies:
- holoviews
- hvplot
- mypy >=1.18.2
- nbval
- numpydoc >=1.9.0
- pooch >=1.8.0
- pre-commit >=3.5.0
Expand Down
2 changes: 1 addition & 1 deletion environment-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- clisops >=0.15.0
- gcsfs
- gdal >=3.1
- h5netcdf >=1.3.0
- h5netcdf >=1.5.0
# Needed for notebooks/HydroShare_integration.ipynb
# See: https://github.com/CSHS-CWRA/RavenPy/pull/326
# - "hsclient",
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ dependencies = [
"click >=8.2.0",
"climpred >=2.4.0",
"dask >=2024.8.1",
"h5netcdf >=1.3.0",
"h5netcdf >=1.5.0",
"haversine >=2.8.0",
"matplotlib >=3.6.0",
"numpy >=1.25.0",
"owslib >=0.29.1",
"pandas >=2.2.0",
"pint >=0.24.4",
"pydantic >=2.11,<2.12",
"pydap >=3.4.0,<3.5.5", # pydap 3.5.5 is not currently supported by `xarray` (v2025.3.1)
"pydantic >=2.11",
"pydap >=3.5.6",
"pymbolic >=2024.2",
"scipy >=1.11.0",
"spotpy >=1.6.1",
Expand Down
2 changes: 1 addition & 1 deletion src/ravenpy/config/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def nc_specs(
attrs["units"] = nc_var.attrs.get("units")
if attrs["units"] is not None:
s, o = infer_scale_and_offset(nc_var, data_type)
attrs["linear_transform"] = dict(scale=s, offset=o)
attrs["linear_transform"] = {"scale": s, "offset": o}
if mon_ave:
ma = MonthlyAverages.get(data_type)
if ma:
Expand Down
6 changes: 1 addition & 5 deletions src/ravenpy/ravenpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,7 @@ def storage(self):
def hydrograph(self):
if len(self.files["hydrograph"]) == 0:
raise ValueError("No file found, make sure you have the right `run_name` and output `paths`.")
return xr.concat(
[xr.open_dataset(f) for f in self.files["hydrograph"]],
dim=self._dim,
coords="different",
)
return xr.concat([xr.open_dataset(f) for f in self.files["hydrograph"]], dim=self._dim, coords="different", compat="equals")


def run(
Expand Down
8 changes: 0 additions & 8 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import pytest
from packaging.version import Version
from pydap import __version__ as __pydap_version__

from ravenpy.config.utils import nc_specs


older_pydap = False
if Version(__pydap_version__) < Version("3.5.5"):
older_pydap = True


def test_nc_specs(yangtze):
f = yangtze.fetch("raven-gr4j-cemaneige/Salmon-River-Near-Prince-George_meteo_daily.nc")
attrs = nc_specs(f, "PRECIP", station_idx=1, alt_names=("rain",))
Expand Down Expand Up @@ -41,7 +34,6 @@ def test_nc_specs_bad(bad_netcdf):


@pytest.mark.online
@pytest.mark.skipif(older_pydap, reason="pydap version 3.5.5 is required for this test", strict=False)
def test_dap_specs():
# Link to THREDDS Data Server netCDF testdata
tds = "https://pavics.ouranos.ca/twitcher/ows/proxy/thredds/dodsC/birdhouse/testdata/raven"
Expand Down