-
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
Pre-calculate flow neighbor IDs for Pump, Outlet, UserDemand, FractionalFlow, TabulatedRatingCurve #1448
Conversation
Because after Parameter construction is too late now, since we cannot put wrong neighbors in the structs anymore. So instead do the validation on the graph.
This was a bit more involved. With the new additions to the structs we can no longer create Parameters with the wrong number of nodes, breaking the validation tests for this. So I had to move the neighbor validation earlier, directly after graph construction. |
core/src/model.jl
Outdated
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.
This wasn't called before.
core/src/util.jl
Outdated
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.
Removed this since we already have a nodetypes::Vector{Symbol}
for similar purposes. For that I also added a test.
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.
This model is not used to test neighbor counts, so I had to add a missing outflow edge to allow the construction of Parameters.
if nodetype != :Terminal | ||
# It has a struct which is added to Parameters | ||
T = getproperty(Ribasim, nodetype) | ||
@test T <: AbstractParameterNode |
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.
Nice, lack of this gave some problems before
Takes another chunk out of #889
Also does some refactoring to make the solve methods more uniform.