-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement Hype forcing & model #308
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@sverhoeven the notebook hype.ipynb using docker gives the error: ---------------------------------------------------------------------------
DeadContainerException Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 cfg_file, cfg_dir = model.setup()
2 cfg_file, cfg_dir
File ~/GitHub/ewatercycle/src/ewatercycle/models/hype.py:152, in Hype.setup(self, start_time, end_time, crit_time, cfg_dir)
150 # start container
151 work_dir = str(cfg_dir_as_path)
--> 152 self.bmi = _start_container(self.version, work_dir)
154 return str(cfg_file), work_dir
File ~/GitHub/ewatercycle/src/ewatercycle/models/hype.py:217, in _start_container(version, work_dir)
215 elif CFG["container_engine"].lower() == "docker":
216 image = _version_images[version]["docker"]
--> 217 return BmiClientDocker(
218 image=image,
219 image_port=55555, # TODO needed?
220 work_dir=work_dir,
221 )
222 else:
223 raise ValueError(
224 f"Unknown container technology in CFG: {CFG['container_engine']}"
225 )
File ~/mambaforge/envs/ewatercycle/lib/python3.10/site-packages/grpc4bmi/bmi_client_docker.py:88, in BmiClientDocker.__init__(self, image, work_dir, image_port, host, input_dirs, user, remove, delay, timeout)
86 logs = self.logs()
87 msg = f'Failed to start Docker container with image {image}, Container log: {logs}'
---> 88 raise DeadContainerException(msg, exitcode, logs)
90 super(BmiClientDocker, self).__init__(BmiClient.create_grpc_channel(port=port, host=host), timeout=timeout)
DeadContainerException: Failed to start Docker container with image ewatercycle/hype-grpc4bmi:feb2021, Container log: terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid I submitted issue eWaterCycle/ewatercycle-hype#5 |
|
||
forcing_file = Path(forcing_path).name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the from pathlib import Path
at the top of the module can be removed. Shall we also add Hype generate forcing (e.g. the code block below) to the notebook generate_forcing.ipynb?
# Hype
hype_forcing = ewatercycle.forcing.generate(
target_model="hype",
dataset="ERA5",
start_time="1990-01-01T00:00:00Z",
end_time="1990-12-31T00:00:00Z",
shape="./data/Rhine/Rhine.shp",
)
print(hype_forcing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added, including the print output
docs/examples/hype.ipynb
Outdated
"outputs": [], | ||
"source": [ | ||
"parameter_set_dir = \"<path where demo.zip was extracted to>\"\n", | ||
"parameter_set_dir = \"/tmp/o/demo\"\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"parameter_set_dir = \"/tmp/o/demo\"\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sverhoeven I tested the notebook on Snellius. It works. I left some minor comments. We need to add "Hype" to example.rst as well. Similar to other notebooks, we may run the model for a short time period and plot the time series in the notebook hype.ipynb.
Added hype to examples.rst and discharge is plotted now. |
Kudos, SonarCloud Quality Gate passed! |
esmvaltool issue ESMValGroup/ESMValTool#2678 |
thanks for reviewing. I spawned some additional issues eWaterCycle/ewatercycle-hype#6, eWaterCycle/ewatercycle-hype#4 |
TODO
Add https://sourceforge.net/projects/hype/files/release_hype_5_6_2/demo.zip as example parameter setfind demo set where spatial position is known of sub-basins and then use model.get_value_as_xarray()