Skip to content

Conversation

@mikeprosserni
Copy link
Collaborator

@mikeprosserni mikeprosserni commented Jun 13, 2025

What does this Pull Request accomplish?

This changes the way users will write their streamlit scripts. Instead of writing this:

import nipanel

panel = nipanel.StreamlitPanelValueAccessor(panel_id="sample_panel")

users will write this:

import nipanel

panel = nipanel.initialize_panel()

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.)

@github-actions
Copy link
Contributor

github-actions bot commented Jun 13, 2025

Test Results

 10 files  ±0   10 suites  ±0   13s ⏱️ -4s
 78 tests ±0   78 ✅ ±0  0 💤 ±0  0 ❌ ±0 
750 runs  ±0  750 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 2d589f1. ± Comparison against base commit 44d18cc.

♻️ This comment has been updated with latest results.

@mikeprosserni mikeprosserni marked this pull request as ready for review June 13, 2025 19:22
@mikeprosserni mikeprosserni requested a review from csjall as a code owner June 13, 2025 19:22
@mikeprosserni mikeprosserni merged commit 5699b8c into main Jun 13, 2025
14 checks passed
@mikeprosserni mikeprosserni deleted the users/mprosser/task-3163243-cache-value-accessor branch June 13, 2025 21:20
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.

4 participants