Add initialize_panel() so that StreamlitPanelValueAccessor can be cached between runs #70
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.
What does this Pull Request accomplish?
This changes the way users will write their streamlit scripts. Instead of writing this:
users will write this:
The initialize_panel() function will create a SPVA, but will cache it so that it isn't recreated every time the script is rerun. Also, the function will automatically get the panelId from the baseUrlPath, so the user doesn't have to provide it.
Why should this Pull Request be merged?
Implements AB#3163243
What testing has been done?
Running sample.py with the new sample_panel.py, I verified in the debugger that the SPVA was not recreated when the rerun button was clicked.
(In order to attach the debugger to the sample_panel.py and _streamlit_panel_initializer.py, I added debugpy as a project dependency. I also added .vscode/launch.json to the .gitignore so that my debug configuration would not be checked in.)