-
Couldn't load subscription status.
- Fork 0
Add a panel accessor class for streamlit scripts to call #31
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
Add a panel accessor class for streamlit scripts to call #31
Conversation
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.
Pull Request Overview
Adds a generic panel accessor and streamlines Streamlit panel APIs while updating dependencies
- Introduce PanelAccessor and specialized StreamlitPanelAccessor to consolidate get/set logic
- Refactor StreamlitPanel to inherit from PanelAccessor and use a shared constant
- Bump Python requirement to 3.9.8 and add Streamlit dependency; update tests for the new accessor
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test_streamlit_panel.py | Updated imports and added tests for StreamlitPanelAccessor |
| src/nipanel/_streamlit_panel_accessor.py | New StreamlitPanelAccessor class wrapping PanelAccessor |
| src/nipanel/_streamlit_panel.py | Refactored to inherit PanelAccessor and use STREAMLIT_PYTHON_PANEL_SERVICE |
| src/nipanel/_streamlit_constants.py | New constant for the Streamlit panel service interface |
| src/nipanel/_panel_accessor.py | New base class consolidating get/set value functionality |
| src/nipanel/_panel.py | Refactored Panel to subclass PanelAccessor, removed duplication |
| src/nipanel/init.py | Exported StreamlitPanelAccessor |
| pyproject.toml | Bumped Python to ^3.9.8 and added Streamlit >=1.24 dependency |
Comments suppressed due to low confidence (3)
src/nipanel/_panel.py:7
- GrpcChannelPool is imported but unused in this file. Consider removing the import to keep the code clean.
from ni_measurement_plugin_sdk_service.grpc.channelpool import GrpcChannelPool
src/nipanel/_panel_accessor.py:22
- The constructor docstring only documents
panel_idandgrpc_channel. Please add entries fordiscovery_clientandgrpc_channel_poolto fully describe all parameters.
"""Create an accessor for a Streamlit panel.
src/nipanel/_panel.py:12
- The class references ABC but does not import it. Add
from abc import ABCat the top of the file to avoid a NameError.
class Panel(PanelAccessor, ABC):
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.
Approved with suggestions
…s/mprosser/task-3121341-panel-accessor
What does this Pull Request accomplish?
The PythonPanelService has two clients, the measurement script and the streamlit script. This PR is providing a new
PanelAccessorclass for the streamlit script to use to get/set values for controls. UnlikePanel, thePanelAccessorcannot open or close panels, it can only get and set values.Note, I changed the available python versions of this project to exclude 3.9.7, because streamlit (which is now a dependency) doesn't work with 3.9.7.
Why should this Pull Request be merged?
Implements AB#3121341 - Create client library to connect Streamlit panel to Python Panel Service
What testing has been done?
Added new autotests