Skip to content
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

Merged
merged 8 commits into from
May 7, 2024

Conversation

visr
Copy link
Member

@visr visr commented May 2, 2024

Takes another chunk out of #889
Also does some refactoring to make the solve methods more uniform.

visr added 5 commits May 2, 2024 13:21
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.
@visr
Copy link
Member Author

visr commented May 3, 2024

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.

Copy link
Member Author

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
Copy link
Member Author

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.

Copy link
Member Author

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
Copy link
Collaborator

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

@SouthEndMusic SouthEndMusic changed the title Pre-calculate flow neighbor IDs for Pump, Outlet, UserDemand, FractionalFlow Pre-calculate flow neighbor IDs for Pump, Outlet, UserDemand, FractionalFlow, TabulatedRatingCurve May 7, 2024
@SouthEndMusic SouthEndMusic merged commit 8b556aa into main May 7, 2024
23 of 24 checks passed
@SouthEndMusic SouthEndMusic deleted the more-perf branch May 7, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants