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

Fixed disconnect when output variable is chosen before "Load Graph" #82

Merged
merged 7 commits into from
Sep 18, 2024

Conversation

ciara-donegan
Copy link
Collaborator

@ciara-donegan ciara-donegan commented Sep 13, 2024

Issue #77
The app disconnected if the selected SSPs were changed, then a new output variable was chosen (in that order). When trying to pull selected scenarios to plot when the output variable was changed, the app would take whichever SSPs were selected at that moment, rather than the ones that were actually used for the previous Hector run (i.e. it would try to fetch an output from a scenario that had not been run).
image

Solution:
After a Hector run (when the app first loads, or when Load Graphs is clicked), the scenario(s) for the run are stored in the R6 class. When the output variable is changed and that output is fetched from the core, the app now uses the selected scenario(s) from the R6 class rather than directly from the SSP input variable, making sure that the correct scenarios are used.

This PR closes #77

New variables can be selected without having to click "Load Graphs" first, by carrying over the "runs" var as r6$output instead of creating a new blank variable. This does cause the app to crash if a new SSP is selected after selecting new variables, though, so it's not a complete fix
Selecting a new output variable now draws the chosen SSP from the R6 class rather than the shiny input, ensuring that it uses the SSPs that were selected at the time "Load Graph" was last clicked (or when app was opened). This does impact plotting (and downloading data) -- when you change output variables, it will only plot one SSP and you have to click Load Graph to show both again.
Another update to the flow of selecting SSPs and parameters -- the app will no longer crash, but users will need to select Load Graphs when selecting new parameters or else only the first selected SSP will plot. Gets rid of disconnect issue (seemingly completely?) but does cause issue with plotting.
When a new output variable is selected, the SSPs/parameters selected the last time Load Graphs was clicked (or when the app loaded) will remain the same, until Load Graphs is clicked again.
Condensed line of code where vars are fetched when output variable is changed
@stephpenn1
Copy link
Collaborator

Hi Ciara, these changes look good, and all checks have passed. Thanks for the detailed PR description.

@stephpenn1 stephpenn1 merged commit dca760f into dev Sep 18, 2024
3 checks passed
@stephpenn1 stephpenn1 deleted the bug-disconnect branch September 18, 2024 16:26
@stephpenn1 stephpenn1 mentioned this pull request Oct 1, 2024
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