From f5272ba919c9f55e59aa9f5fde0d712ab2387074 Mon Sep 17 00:00:00 2001 From: Bart Schilperoort Date: Wed, 18 Sep 2024 16:59:53 +0200 Subject: [PATCH 1/4] Use conda lock env for tests --- .github/workflows/test.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 41e15c5..b2d9cf2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,19 +9,16 @@ on: jobs: test: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10"] - fail-fast: false - name: Run tests in mamba environment ${{ matrix.python-version }} + name: Run tests in mamba environment steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Download mamba environment.yml run: - wget https://raw.githubusercontent.com/eWaterCycle/ewatercycle/main/environment.yml + wget https://raw.githubusercontent.com/eWaterCycle/ewatercycle/main/conda-lock.yml - uses: mamba-org/setup-micromamba@v1 with: - environment-file: environment.yml + environment-file: conda-lock.yml + environment-name: ci cache-environment: true init-shell: bash - name: Install dependencies From 3cdefe8240f8d41fe0b92c6d2f3e357cac4df1da Mon Sep 17 00:00:00 2001 From: Bart Schilperoort Date: Wed, 18 Sep 2024 17:08:27 +0200 Subject: [PATCH 2/4] Make tests conform to ewatercycle 2.3.1 --- tests/test_forcing.py | 4 +++- tests/test_model_m01.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_forcing.py b/tests/test_forcing.py index 4026958..14e1c65 100644 --- a/tests/test_forcing.py +++ b/tests/test_forcing.py @@ -134,6 +134,8 @@ def test_saved_yaml_content(self, forcing, tmp_path): """\ start_time: '1989-01-02T00:00:00Z' end_time: '1999-01-02T00:00:00Z' + shape: Rhine.shp + filenames: {} forcing_file: marrmot.mat """ ) @@ -143,7 +145,7 @@ def test_saved_yaml_content(self, forcing, tmp_path): def test_saved_yaml(self, forcing, tmp_path): saved_forcing = MarrmotForcing.load(tmp_path) # shape should is not included in the yaml file - forcing.shape = None + forcing.shape = forcing.directory / "Rhine.shp" assert forcing == saved_forcing diff --git a/tests/test_model_m01.py b/tests/test_model_m01.py index f2149bc..a0948b0 100644 --- a/tests/test_model_m01.py +++ b/tests/test_model_m01.py @@ -57,7 +57,9 @@ def test_str(self, model, forcing_file): [ "MarrmotForcing(start_time='1989-01-01T00:00:00Z', ", f"end_time='1992-12-31T00:00:00Z', directory={repr(Path(forcing_file).parent)}, ", - "shape=None, forcing_file='BMI_testcase_m01_BuffaloRiver_TN_USA.mat')", + "shape=None, ", + "filenames={}, ", + "forcing_file='BMI_testcase_m01_BuffaloRiver_TN_USA.mat')", ] ) expected = f"parameter_set=None forcing={expected_forcing}" From e8809649ba8479fb7a8e5ab84ce04a98fdb2ef2c Mon Sep 17 00:00:00 2001 From: Bart Schilperoort Date: Wed, 18 Sep 2024 17:14:47 +0200 Subject: [PATCH 3/4] Bump plugin version, pin ewatercycle version higher --- pyproject.toml | 2 +- src/ewatercycle_marrmot/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0d41572..7b1d95e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ # Include here only the dependencies for the eWaterCycle wrapped model dependencies = [ - "ewatercycle>=2.0.0b2", + "ewatercycle>=2.3.1", ] dynamic = ["version"] diff --git a/src/ewatercycle_marrmot/__init__.py b/src/ewatercycle_marrmot/__init__.py index 3b93d0b..27fdca4 100644 --- a/src/ewatercycle_marrmot/__init__.py +++ b/src/ewatercycle_marrmot/__init__.py @@ -1 +1 @@ -__version__ = "0.0.2" +__version__ = "0.0.3" From 260356f971eaa921062756caf20b1203f32f955e Mon Sep 17 00:00:00 2001 From: Bart Schilperoort Date: Thu, 19 Sep 2024 13:05:16 +0200 Subject: [PATCH 4/4] Revert version: not needed as only tests are modified --- src/ewatercycle_marrmot/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ewatercycle_marrmot/__init__.py b/src/ewatercycle_marrmot/__init__.py index 27fdca4..3b93d0b 100644 --- a/src/ewatercycle_marrmot/__init__.py +++ b/src/ewatercycle_marrmot/__init__.py @@ -1 +1 @@ -__version__ = "0.0.3" +__version__ = "0.0.2"