Skip to content
Merged
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
11 changes: 8 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
include:
- os: 'ubuntu-latest'
python-version: '3.10'
tox-env: 'py3.10-coveralls-upstream'
tox-env: 'py3.10-coverage-upstream'
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
if [ "${{ matrix.tox-env }}" != "false" ]; then
python3 -m tox -e ${{ matrix.tox-env }}
elif [ "${{ matrix.python-version }}" != "3.13" ]; then
python3 -m tox -e py${{ matrix.python-version }}-coveralls
python3 -m tox -e py${{ matrix.python-version }}-coverage
else
python3 -m tox -e py${{ matrix.python-version }}
fi
Expand Down Expand Up @@ -197,6 +197,7 @@ jobs:
parallel: true

finish:
name: Finish
needs:
- pip
- conda
Expand All @@ -206,7 +207,11 @@ jobs:
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
disable-sudo: true
egress-policy: audit
egress-policy: block
allowed-endpoints: >
coveralls.io:443
github.com:443
objects.githubusercontent.com:443
- name: Coveralls Finished
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
with:
Expand Down
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Contributors
------------

* Louise Arnal <arnal.louise@ouranos.ca> `@lou-a <https://github.com/lou-a>`_
* Pascal Bourgault <bourgault.pascal@ouranos.ca> `@aulemahal <https://github.com/aulemaha>`_
* Pascal Bourgault <bourgault.pascal@ouranos.ca> `@aulemahal <https://github.com/aulemahal>`_
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ Changelog
v0.18.0 (unreleased)
--------------------

New features
^^^^^^^^^^^^
* `ravenpy` now supports Python3.13. (PR #459)
* Updated `raven-hydro` to v0.4.0 (`RavenHydroFramework` v4.0.1). (PR #459)
* Updated `xclim` to v0.54.0, `pint` to v0.24.4, and `numpy` to v1.24.0 (no longer pinned below v2.0). (PR #459)
* `ravenpy` is now registered with the Open Source Security Foundation (OSSF) Best Practices initiative (`RavenPy OpenSSF-BP Status <https://www.bestpractices.dev/en/projects/10064>`_). (PR #464)
* `ravenpy` now enables new EvaluationMetrics commands in the model configuration. Other features from `RavenHydroFramework` will be included in newer releases. (PR #476)

Bug fixes
^^^^^^^^^
Expand All @@ -25,6 +28,9 @@ Internal changes
* Spelling errors in documentation have been addressed.
* GitHub Workflows now test `ravenpy` using macOS as well as Python3.13. (PR #459)
* Several small deprecation and usage warnings as well as a few variable typing issues have been addressed. (PR #464)
* Updated the license to reflect current year. (PR #476)
* Documentation version now supports showing hyphens in the version number. (PR #476)
* Call signatures and docstrings of functions have been modified to be more precise for the expected variable type. (PR #476)

v0.17.0 (2025-01-27)
--------------------
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2024 David Huard, Trevor James Smith, Christian Jauvin, Julie Mai, Ming Han
Copyright (c) 2020-2025 David Huard, Trevor James Smith, Christian Jauvin, Julie Mai, Ming Han

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RavenPy |logo|
+----------------------------+-----------------------------------------------------+


A Python wrapper to setup and run the hydrologic modelling framework Raven_.
A Python wrapper for configuring and running the hydrologic modelling framework Raven_.

* Free software: MIT license
* Documentation: https://ravenpy.readthedocs.io
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def rebuild_readme():
# the built documents.
#
# The short X.Y version.
version = ravenpy.__version__
version = ravenpy.__version__.split("-")[0]
# The full version, including alpha/beta/rc tags.
release = ravenpy.__version__

Expand Down
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
- pint >=0.24.4
- platformdirs >=4.3.6
- pydantic >=2.0
- pydap >=3.4.0
- pydap >=3.4.0 # Note: As of 2025-03-18 (v3.5.4) does not support Python 3.13
- pymetalink >=6.5.2
- pymbolic >=2024.2
- pyproj >=3.3.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies = [
"pint >=0.24.4",
"platformdirs >=4.3.6",
"pydantic >=2.0",
"pydap >=3.4.0",
"pydap >=3.4.0", # Note: As of 2025-03-18 (v3.5.4) does not support Python 3.13
"pymbolic >=2024.2",
"raven-hydro >=0.4.0,<1.0",
"scipy >=1.11.0",
Expand Down
4 changes: 2 additions & 2 deletions src/ravenpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""A Python wrapper to setup and run the hydrologic modelling framework Raven."""
"""A Python wrapper for configuring and running the hydrologic modelling framework Raven."""

###################################################################################
# MIT License
#
# Copyright (c) 2020-2024 David Huard, Trevor James Smith, Christian Jauvin, Julie Mai, Ming Han
# Copyright (c) 2020-2025 David Huard, Trevor James Smith, Christian Jauvin, Julie Mai, Ming Han
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions src/ravenpy/cli/aggregate_forcings_to_hrus.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def aggregate_forcings_to_hrus(
command will require.
"""
# NOTE: This is in order to make sphinx-click happy. Magic. Do not touch.
import netCDF4 as nc4 # noqa: N813
import netCDF4
import numpy as np

gws = GridWeights.parse(Path(input_weight_file).read_text())
Expand All @@ -76,7 +76,7 @@ def aggregate_forcings_to_hrus(
weights_data = gws.data

# read NetCDF
nc_in = nc4.Dataset(input_nc_file, "r")
nc_in = netCDF4.Dataset(input_nc_file, "r")

# length of dimensions
nlon = nc_in.dimensions[dim_names[0]].size
Expand Down Expand Up @@ -107,7 +107,7 @@ def aggregate_forcings_to_hrus(
else:
output_nc_file_path = Path(output_nc_file)

nc_out = nc4.Dataset(output_nc_file_path, "w")
nc_out = netCDF4.Dataset(output_nc_file_path, "w")
_ = nc_out.createDimension("time", ntime)
_ = nc_out.createDimension("nHRU", nHRU)

Expand Down
4 changes: 2 additions & 2 deletions src/ravenpy/config/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def parse_symbolic(value, **kwds):
Note that parsing the output of `model_dump` can cause problems because there is not always enough information in the
dictionary to recreate the correct model.
"""
from pymbolic.mapper.evaluator import EvaluationMapper as EM # noqa: N817
from pymbolic.mapper.evaluator import EvaluationMapper
from pymbolic.primitives import ExpressionNode, Variable

if isinstance(value, dict):
Expand All @@ -337,7 +337,7 @@ def parse_symbolic(value, **kwds):

elif isinstance(value, (Variable, ExpressionNode)):
# Inject numerical values numerical value
return EM(context=kwds)(value)
return EvaluationMapper(context=kwds)(value)

else:
return value
4 changes: 2 additions & 2 deletions src/ravenpy/config/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@

def nc_attrs(cls, val):
"""Ensure default netCDF attributes are present."""
# FIXME: assertions should not be found outside of testing code. Replace with conditional logic.
assert "model_id" in val # noqa: S101
if "model_id" not in val:
raise ValueError("The key 'model_id' must be present in the input dictionary.")

out = default_nc_attrs()
out.update(val)
Expand Down
2 changes: 1 addition & 1 deletion src/ravenpy/config/emulators/gr4jcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class GR4JCN(Config):
p.Split(
algo="RAVEN_DEFAULT",
source="SOIL[2]",
to=["CONVOLUTION[0]", "CONVOLUTION[1]"],
to=("CONVOLUTION[0]", "CONVOLUTION[1]"),
p=0.9,
),
p.Convolve(algo="CONVOL_GR4J_1", source="CONVOLUTION[0]", to="SOIL[1]"),
Expand Down
Loading
Loading