-
Notifications
You must be signed in to change notification settings - Fork 6
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
Allow missing 'Basin / time' data #1028
Conversation
From the imod coupler perspective, it's a bit onerous. Having to set all entries to NaN, except the first feels very specific. Ideally, I think the following would work as preparation for the coupling step: df = ribasim_model.basin.df
df.loc[df["node_id"].isin(coupled_node_ids), ["drainage", "infiltration"]] = np.nan Requires altering this in Ribasim:
using Having zero as values if they are not defined here feels reasonable? |
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 initialized with zeros and allowed NaN for the other columns as well.
Also added a simple test model.
Does this work well for you?
Judging from the test, this does exactly the right thing. I'll try and run this branch on one of my local models to be sure. |
Missing is currently only allowed in the basin.time, thanks to #1028. This makes it consistent and allows it for basin.static as well (which is currently the reason a bunch of imod_coupler tests are failing). --------- Co-authored-by: Martijn Visser <[email protected]>
This is a very opportunistic fix to #1027
I'm not sure the
!isnan(value)
check currently does anything meaningful to be honest?It's still a bit tedious to setup: to get it working I need to explicitly set the first date to zero, otherwise it triggers the following error:
error("Missing initial data for the Basin variable drainage")
One way of dealing with this would be to initialize to zeros, and allow "unset" values for optionals. Not sure about it.
Needs a decision, and then we could add some simple tests.