Skip to content

Commit

Permalink
Add 2020.1.2 to wflow versions (#268)
Browse files Browse the repository at this point in the history
* Add 2020.1.2 to wflow versions

* Add wflow 2020.1.2 to system setup

* Ran docs/examples/wflow.ipynb with version=2020.1.2

* Update CHANGELOG
  • Loading branch information
sverhoeven authored Oct 18, 2021
1 parent 5109f53 commit df1bb00
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 40 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Formatted as described on [https://keepachangelog.com](https://keepachangelog.co

## [Unreleased]

### Added

- 2020.1.2 version of wflow model ([#268](https://github.com/eWaterCycle/ewatercycle/pull/268))
- Document how to add a new version of a model ([#266](https://github.com/eWaterCycle/ewatercycle/pull/266))

## [1.1.2] (2021-09-29)

### Added
Expand Down
83 changes: 46 additions & 37 deletions docs/examples/wflow.ipynb

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/system_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ Docker images will be downloaded with ``docker pull``:
docker pull ewatercycle/marrmot-grpc4bmi:2020.11
docker pull ewatercycle/pcrg-grpc4bmi:setters
docker pull ewatercycle/wflow-grpc4bmi:2020.1.1
docker pull ewatercycle/wflow-grpc4bmi:2020.1.2
Singularity
~~~~~~~~~~~
Expand All @@ -256,6 +257,7 @@ Singularity images should be stored in configured directory
singularity build ewatercycle-marrmot-grpc4bmi_2020.11.sif docker://ewatercycle/marrmot-grpc4bmi:2020.11
singularity build ewatercycle-pcrg-grpc4bmi_setters.sif docker://ewatercycle/pcrg-grpc4bmi:setters
singularity build ewatercycle-wflow-grpc4bmi_2020.1.1.sif docker://ewatercycle/wflow-grpc4bmi:2020.1.1
singularity build ewatercycle-wflow-grpc4bmi_2020.1.2.sif docker://ewatercycle/wflow-grpc4bmi:2020.1.2
cd -
Download example parameter sets
Expand Down
6 changes: 4 additions & 2 deletions src/ewatercycle/models/wflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Wflow(AbstractModel[WflowForcing]):
If None, it is assumed that forcing is included with the parameter_set.
"""

available_versions = ("2020.1.1",)
available_versions = ("2020.1.1", "2020.1.2")
"""Show supported WFlow versions in eWaterCycle"""

def __init__( # noqa: D107
Expand All @@ -51,12 +51,14 @@ def _set_docker_image(self):
images = {
# "2019.1": "ewatercycle/wflow-grpc4bmi:2019.1", # no good ini file
"2020.1.1": "ewatercycle/wflow-grpc4bmi:2020.1.1",
"2020.1.2": "ewatercycle/wflow-grpc4bmi:2020.1.2",
}
self.docker_image = images[self.version]

def _singularity_image(self, singularity_dir):
images = {
"2020.1.1": "ewatercycle-wflow-grpc4bmi_2020.1.1.sif",
"2020.1.2": "ewatercycle-wflow-grpc4bmi_2020.1.2.sif",
}
image = singularity_dir / images[self.version]
return str(image)
Expand All @@ -79,7 +81,7 @@ def _setup_default_config(self):
cfg.set("inputmapstacks", "Temperature", forcing.Temperature)
cfg.set("run", "starttime", _iso_to_wflow(forcing.start_time))
cfg.set("run", "endtime", _iso_to_wflow(forcing.end_time))
if self.version == "2020.1.1":
if self.version in self.available_versions:
if not cfg.has_section("API"):
logger.warning(
"Config file from parameter set is missing API section, "
Expand Down
2 changes: 1 addition & 1 deletion src/ewatercycle/parameter_sets/_wflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ def example_parameter_sets() -> Iterable[ExampleParameterSet]:
config_url="https://github.com/openstreams/wflow/raw/master/examples/wflow_rhine_sbm_nc/wflow_sbm_NC.ini", # noqa: E501
doi="N/A",
target_model="wflow",
supported_model_versions={"2020.1.1"},
supported_model_versions={"2020.1.1", "2020.1.2"},
)
]

0 comments on commit df1bb00

Please sign in to comment.