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

Copy soil layer setting csv to input folder + add a BMI MODFLOW coupling notebook #104

Merged
merged 36 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8149e06
Implement groundwater coupling changes in BMI
BSchilperoort Mar 13, 2024
d17ed45
Implement new groundwater coupling variables
BSchilperoort Jul 12, 2024
ab814d4
Programatically get/set values
BSchilperoort Jul 12, 2024
70ecfeb
Remove outdated test
BSchilperoort Jul 12, 2024
18bfe6d
Pin dependencies to working versions
BSchilperoort Jul 12, 2024
c0a75a2
Fix issues related to variables containing all timesteps
BSchilperoort Jul 15, 2024
d82af5e
Add notebook demonstrating the groundwater coupling through BMI
BSchilperoort Jul 15, 2024
ded2b50
add MODFLOW coupling example
Aug 21, 2024
61f353b
add soil layers setting path
Aug 21, 2024
747cc4c
add soil layers setting path
Aug 21, 2024
09872fe
add soil layers setting path
Aug 21, 2024
2600de7
add soil layers setting path
Aug 21, 2024
c8e5955
Update comment in line 127
MostafaGomaa93 Aug 23, 2024
ed456c3
Add a key for optional soil thickness layer csv file
MostafaGomaa93 Aug 23, 2024
3302d54
add key for soil layer thickness csv file
Aug 23, 2024
e8424ae
add example comment in mkdocs.yml
Aug 25, 2024
e174118
add example comment in mkdocs.yml
Aug 25, 2024
0128240
adjust BMI_MODFLOW notebook
Aug 25, 2024
fe58c21
adjust BMI_MODFLOW notebook
Aug 25, 2024
5f9d3ad
adjust BMI_MODFLOW notebook
Aug 29, 2024
9b37acd
Update bmi_MODFLOW_coupling.ipynb
MostafaGomaa93 Aug 29, 2024
df6fae2
add rechargeTemp to BMI variables
Sep 19, 2024
7189f02
add rechargeTemp to BMI variables
Sep 19, 2024
33955d2
add BMI
Sep 24, 2024
a61bb53
Delete PyStemmusScope/bmi/variable_reference_BACKUP_2561331.py
MostafaGomaa93 Sep 24, 2024
92e6558
Delete PyStemmusScope/bmi/variable_reference_BASE_2561331.py
MostafaGomaa93 Sep 24, 2024
141d03d
Delete PyStemmusScope/bmi/variable_reference_LOCAL_2561331.py
MostafaGomaa93 Sep 24, 2024
79fd36c
Delete PyStemmusScope/bmi/variable_reference_REMOTE_2561331.py
MostafaGomaa93 Sep 24, 2024
3779499
Delete PyStemmusScope/bmi/implementation.py
MostafaGomaa93 Sep 24, 2024
d7234e3
Delete PyStemmusScope/bmi/implementation.py.orig
MostafaGomaa93 Sep 24, 2024
72021b2
Add files via upload
MostafaGomaa93 Sep 24, 2024
d6ce220
add IndxRchrg to BMI
Sep 24, 2024
d9daf97
Update variable_reference.py
MostafaGomaa93 Sep 25, 2024
0b467a3
update the version of docker image
SarahAlidoost Sep 27, 2024
3aae254
fix black errors
SarahAlidoost Sep 27, 2024
e9268ce
add tests for soil_layers_thickness in config
SarahAlidoost Sep 27, 2024
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/ecoextreml/stemmus_scope:1.6.0
FROM ghcr.io/ecoextreml/stemmus_scope:1.6.1

LABEL maintainer="Bart Schilperoort <[email protected]>"
LABEL org.opencontainers.image.source = "https://github.com/EcoExtreML/STEMMUS_SCOPE_Processing"
Expand Down
2 changes: 1 addition & 1 deletion PyStemmusScope/bmi/docker_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class StemmusScopeDocker:
"""Communicate with a STEMMUS_SCOPE Docker container."""

# Default image, can be overridden with config:
compatible_tags = ("1.6.0",)
compatible_tags = ("1.6.1",)

_process_ready_phrase = b"Select BMI mode:"
_process_finalized_phrase = b"Finished clean up."
Expand Down
9 changes: 9 additions & 0 deletions PyStemmusScope/bmi/variable_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ class BmiVariable:
grid=0,
keys=["gwfluxes", "recharge"],
),
BmiVariable(
name="groundwater_recharge_index",
dtype="int64",
input=False,
output=True,
units="-",
grid=0,
keys=["gwfluxes", "indxRchrg"],
),
# groundwater (coupling) vars
BmiVariable(
name="groundwater_coupling_enabled",
Expand Down
10 changes: 10 additions & 0 deletions PyStemmusScope/config_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ def _copy_data(input_dir: Path, config: dict) -> None:

# copy input_data.xlsx
shutil.copy(str(config["input_data"]), str(input_dir))
# copy soil_layers_thickness, this is optional
if "soil_layers_thickness" in config:
if Path(config["soil_layers_thickness"]).is_file():
shutil.copy(str(config["soil_layers_thickness"]), str(input_dir))
else:
raise FileNotFoundError(
"The key `soil_layers_thickness` is provided in the config file, "
f"but file {config['soil_layers_thickness']} not found. "
"Remove the key from the config file or provide the file."
)


def _update_config_file(
Expand Down
6 changes: 3 additions & 3 deletions docs/bmi.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ To use the Docker image, use the `DockerImage` setting in the configuration file
```sh
WorkDir=/home/username/tmp/stemmus_scope
...
DockerImage=ghcr.io/ecoextreml/stemmus_scope:1.6.0
DockerImage=ghcr.io/ecoextreml/stemmus_scope:1.6.1
```

It is best to add the version tag here too (`:1.6.0`), this way the BMI will warn you if the version might be incompatible.
It is best to add the version tag here too (`:1.6.1`), this way the BMI will warn you if the version might be incompatible.

Note that the `docker` package for python is required here. Install this with `pip install PyStemmusScope[docker]`.
Additionally, [Docker](https://docs.docker.com/get-docker/) itself has to be installed.
Expand Down Expand Up @@ -52,7 +52,7 @@ If you need access to other model variables that are not yet available in the BM

A [Docker image is available](https://ghcr.io/ecoextreml/stemmus_scope-grpc4bmi) in which the model as well as the Python BMI have been wrapped in a container. The Docker image is created using the Docker file [here](https://github.com/EcoExtreML/STEMMUS_SCOPE_Processing/blob/main/Dockerfile) and allows communication with a STEMMUS_SCOPE BMI through [grpc4bmi](https://grpc4bmi.readthedocs.io/en/latest/).

Doing so avoids the needs to install PyStemmusScope yourself, only Docker/apptainer and a python environment with grpc4bmi are required. Please note you should not specify `DockerImage` or `ExeFilePath` in the config file if you are using the grpc4bmi interface.
Doing so avoids the needs to install PyStemmusScope yourself, only Docker/apptainer and a python environment with grpc4bmi are required. Please note you should not specify `DockerImage` or `ExeFilePath` in the config file if you are using the grpc4bmi interface.

A demonstration is available [here](notebooks/grpc4bmi_demo.ipynb)

Expand Down
Loading
Loading