Skip to content

Commit

Permalink
Make the plugin compatible with ewatercycle 2.3.1 (#10)
Browse files Browse the repository at this point in the history
* Use conda lock env for tests

* Make tests conform to ewatercycle 2.3.1

* pin ewatercycle version higher
  • Loading branch information
BSchilperoort authored Sep 24, 2024
1 parent 0116bad commit 1ffada5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
4 changes: 3 additions & 1 deletion tests/test_forcing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
)
Expand All @@ -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

Expand Down
4 changes: 3 additions & 1 deletion tests/test_model_m01.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 1ffada5

Please sign in to comment.