-
Notifications
You must be signed in to change notification settings - Fork 3
Issue #1273 cleanup example #1274
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
Conversation
…ils, update texts and format
# Update existing model with new data | ||
# ----------------------------------- | ||
# | ||
# Your dear colleague has brought you some new data for the river package, which |
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.
I like this :D
examples/user-guide/10-cleanup.py
Outdated
# Let's clean up the problematic river data using the | ||
# :meth:`imod.mf6.River.cleanup` method. Note that this method changes the data | ||
# inplace. This means that the package's will be updated, without returning a | ||
# new copy of the package. This means that do comparisons of the |
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.
"that do" = > "that to do"
imod/data/sample_data.py
Outdated
riv_ds_old = gwf_model["riv"].dataset | ||
# Existing RIV package has only layer coord with [1, 3, 5, 6]. This causes | ||
# problems with some methods, at least with cleanup. Therefore align data | ||
# here for the cleanup example. Not sure if we want to support river |
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.
"Not sure if we want to support river packages with limited layer coords"
I'm not sure if we should put the above in the comment.
Instead you could also write:
"River packages with limited layer coords are currently not supported."
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.
I agree, I changed it to "River packages with limited layer coords are currently not fully supported.", as you can apparently write a functional model with the river package in only limited layers, but cannot call cleanup on it. I wasn't sure if we want to support that to begin with.
I really like this way of writing examples!! |
|
Fixes #1273
Description
Add example of cleanup utilities to the user guide. I think it shows a common use-case for cleaning up data.
Technically the most challenging issue was to work around the fact that sphinx_gallery doesn't have an option to select expected errors in specific code blocks. There is this PR to introduce this, but unfortunately for us this has not been finished yet.
I resorted to trapping the error and printing it with a context manager, that seemed like the cleanest solution to me. I added this small context to the public API, so that users can also read in the online documentation what the context manager does.
Checklist
Issue #nr
, e.g.Issue #737