-
Notifications
You must be signed in to change notification settings - Fork 3
Add logging to Modflow 6 simulation #492
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
Milestone
Comments
6 tasks
@Manangka mentioned, the Modflow 6 stdout can be easily added to the logging as follows: def run(self, mf6path: Union[str, Path] = "mf6") -> None:
...
with imod.util.cd(self.directory):
result = subprocess.run(mf6path, capture_output=True)
imod.logging.logger.info(result.stdout.decode())
if result.returncode != 0:
raise RuntimeError(
f"Simulation {self.name}: {mf6path} failed to run with returncode "
f"{result.returncode}, and error message:\n\n{result.stdout.decode()} "
) This has the downside afaik, that things are logged only when the simulation is terminated. Which is useful, but not when you are running a long simulation and want to know its progress. |
5 tasks
JoerivanEngelen
added a commit
that referenced
this issue
Mar 10, 2025
Fixes #492 # Description Adds some simple logging to the simulation object. I didn't add solver settings, these are listed in the .ims file. I also didn't add stdout of MODFLOW6, as this is already logged in the LIST file and would require some extra work. Furthermore some boyscouting: fix some easy-to-fix issues raised by Sonarcloud: - Remove unreachable return statements - Don't use caps in variable's name # Checklist - [x] Links to correct issue - [x] Update changelog, if changes affect users - [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737`` - [ ] Unit tests were added - [ ] **If feature added**: Added/extended example
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In GitLab by @JoerivanEngelen on Jul 25, 2023, 17:41
Add logging to:
The text was updated successfully, but these errors were encountered: