Skip to content

Commit d8747ae

Browse files
authored
Merge branch 'master' into pjei-update-202504
2 parents 00bd966 + 86f86bb commit d8747ae

17 files changed

Lines changed: 147 additions & 46 deletions

.cruft.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"project_slug": "ravenpy",
1111
"project_short_description": "A Python wrapper to setup and run the hydrologic modelling framework Raven.",
1212
"pypi_username": "CSHS-CWRA",
13-
"version": "0.18.0",
13+
"version": "0.18.1-dev.0",
1414
"use_pytest": "y",
1515
"use_black": "y",
1616
"use_conda": "y",

CHANGELOG.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@
22
Changelog
33
=========
44

5-
v0.18.1 (unreleased)
5+
v0.18.1 (2025-04-15)
66
--------------------
77

8+
New features
9+
^^^^^^^^^^^^
10+
* `ravenpy` no longer installs `raven-hydro` by default. The Raven model executable can now be provided by explicitly setting the `RAVENPY_RAVEN_BINARY_PATH` environment variable. (PR #486).
11+
812
Bug fixes
913
^^^^^^^^^
10-
* Fixed a bug in ``ravenpy.utilities.regionalization.multiple_linear_regression`` that was calling a class method incorrectly.
14+
* Fixed a bug in ``ravenpy.utilities.regionalization.multiple_linear_regression`` that was calling a class method incorrectly. (PR #484).
1115

1216
Internal changes
1317
^^^^^^^^^^^^^^^^
14-
* Updated the documentation dependencies to use the latest versions of `sphinx`, `nbsphinx`, and `sphinx-codeautolink`.
15-
* Regenerated the notebook outputs using newer version of `xclim`.
18+
* `pydap` has been pinned below v3.5.5 temporarily until `xarray` offers support for it. (PR #486).
19+
* More than 7500 DeprecationWarnings emitted during the testing suite have been addressed. Minimum supported `pydantic` has been raised to v2.11. (PR #487).
20+
* Updated the documentation dependencies to use the latest versions of `sphinx`, `nbsphinx`, and `sphinx-codeautolink`. (PR #484).
21+
* Regenerated the notebook outputs using newer version of `xclim`. (PR #484).
1622

1723
v0.18.0 (2025-04-03)
1824
--------------------

docs/installation.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,16 @@ Then, from your python environment, run:
5757

5858
.. code-block:: console
5959
60-
python -m pip install ravenpy[gis]
60+
python -m pip install ravenpy[gis,raven-hydro]
6161
6262
If desired, the core functions of `RavenPy` can be installed without its GIS functionalities as well. This implementation of RavenPy is much lighter on dependencies and can be installed easily with `pip`, without the need for `conda` or `virtualenv`.
6363

64+
.. code-block:: console
65+
66+
python -m pip install ravenpy[raven-hydro]
67+
68+
Finally, if you wish to provide your own `Raven` binary, you can install `RavenPy` without installing the `raven-hydro` package:
69+
6470
.. code-block:: console
6571
6672
python -m pip install ravenpy

environment-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ dependencies:
2323
- pandas >=2.2.0
2424
- pint >=0.24.4
2525
- platformdirs >=4.3.6
26-
- pydantic >=2.0
27-
- pydap >=3.4.0 # Note: As of 2025-03-18 (v3.5.4) does not support Python 3.13
26+
- pydantic >=2.11
27+
- pydap >=3.4.0,<3.5.5 # pydap 3.5.5 is not currently supported by `xarray` (v2025.3.1)
2828
- pymetalink >=6.5.2
2929
- pymbolic >=2024.2
3030
- pyproj >=3.3.0

environment-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dependencies:
3131
- netCDF4 >=1.7.2
3232
- numpy >=1.24.0
3333
- notebook
34-
- pydantic >=2.0
34+
- pydantic >=2.11
3535
- pymetalink >=6.5.2
3636
- s3fs
3737
- salib

pyproject.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ dependencies = [
4949
"pandas >=2.2.0",
5050
"pint >=0.24.4",
5151
"platformdirs >=4.3.6",
52-
"pydantic >=2.0",
53-
"pydap >=3.4.0", # Note: As of 2025-03-18 (v3.5.4) does not support Python 3.13
52+
"pydantic >=2.11",
53+
"pydap >=3.4.0,<3.5.5", # pydap 3.5.5 is not currently supported by `xarray` (v2025.3.1)
5454
"pymbolic >=2024.2",
55-
"raven-hydro >=0.4.0,<1.0",
5655
"scipy >=1.11.0",
5756
"spotpy >=1.6.1",
5857
"statsmodels >=0.14.2",
@@ -138,10 +137,14 @@ gis = [
138137
"setuptools >=71.0",
139138
"shapely >=2.0"
140139
]
140+
raven-hydro = [
141+
"raven-hydro >=0.4.0,<1.0"
142+
]
141143
all = [
142144
"ravenpy[dev]",
143145
"ravenpy[docs]",
144-
"ravenpy[gis]"
146+
"ravenpy[gis]",
147+
"ravenpy[raven-hydro]"
145148
]
146149

147150
[project.scripts]
@@ -166,7 +169,7 @@ target-version = [
166169
]
167170

168171
[tool.bumpversion]
169-
current_version = "0.18.0"
172+
current_version = "0.18.1-dev.0"
170173
commit = true
171174
commit_args = "--no-verify"
172175
tag = false

src/ravenpy/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@
2424
# SOFTWARE.
2525
###################################################################################
2626

27+
from ._raven import RAVEN_EXEC_PATH, __raven_version__ # noqa: F401
2728
from .ravenpy import Emulator, EnsembleReader, OutputReader, RavenWarning, run
2829

29-
__all__ = ["Emulator", "EnsembleReader", "OutputReader", "RavenWarning", "run"]
30-
3130
__author__ = """David Huard"""
3231
__email__ = "huard.david@ouranos.ca"
33-
__version__ = "0.18.0"
32+
__version__ = "0.18.1-dev.0"

src/ravenpy/_raven.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""Configurations for raven-hydro."""
2+
3+
import os
4+
import shutil
5+
6+
RAVEN_EXEC_PATH = os.getenv("RAVENPY_RAVEN_BINARY_PATH") or shutil.which("raven")
7+
8+
if not RAVEN_EXEC_PATH:
9+
raise RuntimeError(
10+
"Could not find raven binary in PATH and RAVENPY_RAVEN_BINARY_PATH env variable is not set."
11+
)
12+
13+
try:
14+
from raven_hydro import __raven_version__
15+
except ImportError:
16+
__raven_version__ = "0.0.0"

src/ravenpy/config/base.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ def __subcommands__(self) -> tuple[dict[str, str], list]:
144144
"""Return dictionary of class attributes that are Raven models."""
145145
cmds = {}
146146
recs = []
147-
for key, field in self.model_fields.items():
147+
cls = self.__class__
148+
for key, field in cls.model_fields.items():
148149
obj = self.__dict__[key]
149150
if obj is not None:
150151
if issubclass(obj.__class__, _Record):
@@ -225,8 +226,9 @@ class LineCommand(FlatCommand):
225226
"""
226227

227228
def to_rv(self):
228-
out = [f":{self.__class__.__name__:<20}"]
229-
for field in self.model_fields.keys():
229+
cls = self.__class__
230+
out = [f":{cls.__name__:<20}"]
231+
for field in cls.model_fields.keys():
230232
out.append(str(getattr(self, field))) # noqa: PERF401
231233

232234
return " ".join(out) + "\n"

src/ravenpy/config/defaults.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from raven_hydro import __raven_version__
1+
from ravenpy import __raven_version__
22

33
units = {
44
"PRECIP": "mm/d",
@@ -65,5 +65,5 @@ def default_nc_attrs():
6565
return {
6666
"history": f"Created on {now} by Raven {version}",
6767
"references": "Craig, J.R., and the Raven Development Team, Raven user's and developer's manual "
68-
f"(Version {version}), URL: https://raven.uwaterloo.ca/ (2025).",
68+
f"(Version {version}), URL: https://raven.uwaterloo.ca/ ({dt.datetime.today().year}).",
6969
}

0 commit comments

Comments
 (0)