Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the plugin compatible with ewatercycle 2.3.1 #10

Merged
merged 4 commits into from
Sep 24, 2024
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
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