-
Notifications
You must be signed in to change notification settings - Fork 1
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
Simulations pane #20
Merged
Merged
Simulations pane #20
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…llow panel pattern)
jjnesbitt
requested changes
Sep 20, 2023
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.
Looks good overall, tested locally. Just have a few questions/concerns
Note: I realized that |
jjnesbitt
reviewed
Sep 21, 2023
jjnesbitt
reviewed
Sep 21, 2023
jjnesbitt
approved these changes
Sep 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The Simulations pane introduced in this PR allows the user to create
SimulationResult
objects in the database and view existing results. After picking a Simulation type, the user must specify all required inputs, then they may run the simulation.Details
For this PR, only one Simulation type is implemented, called "Flood Scenario 1". Simulation types (not to be conflated with

SimulationResult
s) are not database objects. Rather, they exist as a hard-coded mapping of celery tasks. The simulation types populate the side-panel under "Available Simulations."(Side note: this PR also switches the order of the "Available Layers" and "Active Layers" panels for consistency with the other panels' organization)
When the user selects a simulation type, the simulations pane appears for the selected type. The pane has two tabs: a tab to create a new

SimulationResult
object, and a tab to view existing ones. The tab to create a new one allows the user to specify all the inputs required for the selected simulation type. Once all required inputs are specified, the user may run the simulation.The request to run a simulation creates a

SimulationResult
object, which it returns to the client and sends into a Celery task to fill in theoutput_data
field. While the celery task is running, the client shows theSimulationResult
object'sinput_args
andmodified_date
, as well as a spinner while theoutput_data
is undefined. While the spinner is shown, the client polls the server every two seconds for an update.Once the celery task is complete, the client will receive the updated

output_data
on the targetSimulationResult
object and display it. In the case of "Flood Scenario 1", the output type is "node_failure_animation", so a specialized component calledNodeFailureAnimation
is displayed in the results section onceoutput_data
is defined. The node failure animation can be played forward or backward (with 1 second ticks) or the user can go directly to a step using the slider.As the slider moves, the list of
deactivatedNodes
changes. The new value is equal to the node failure list, sliced to end on the index of the current tick. (On the second tick,deactivatedNodes
contains 2 node ids.) As the list of deactivated nodes changes, the client sends acomputeGCC
request and updates the map with the response. This happens in the same manner as when the user manually updates the deactivated nodes.The video attached below shows this behavior.
Results
uvdat_simulations_compressed.mp4