Doric preflight-armed driver is reused at runtime but stimulation startup still calls connect()
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- embedded-iot
Research direction
Read preflight_ui.py::_arm_laser_for_launch(), then follow stim_controller.py::from_config() and start() to trace reuse of live_state.laser_driver. Check doric_light_source.py::connect() and the bundled Doric lifecycle examples. Done means the preflight-armed path is explicit, skips a second connect(), and distinguishes reuse from fresh initialization without changing launch blocking.
Written by the indexing model from the issue text.
Description
Summary
When a laser run is verified in preflight, we keep a live DoricLightSource in live_state.laser_driver and reuse it during runtime. However, StimulationController.start() still unconditionally calls driver.connect().
Why this is confusing
- Preflight launch verification already opens the Doric device and leaves it armed.
- Runtime reuses that same driver object via
live_state.laser_driver. start()still callsconnect()as if runtime owns first initialization.- This currently works only because
DoricLightSource.connect()short-circuits whenself._dll is not None.
Code references
preflight_ui.py:_arm_laser_for_launch()stores the armed driver inlive_state.laser_driver.stim_controller.py:from_config()reuseslive_state.laser_driverwhen present.stim_controller.py:start()still callsself._config.driver.connect()unconditionally.doric_light_source.py:connect()returns early when_dllis already set.
Local evidence
- Bundled Doric examples show a single lifecycle:
init -> open_device -> use -> close_device -> quit. - We did not find local documentation explicitly stating that repeated
connect()on an already-open device is supported. - In the current reuse path, the second
connect()is probably harmless because our wrapper short-circuits, but that is wrapper behavior, not a documented Doric contract.
Desired fix
- Make the preflight-armed runtime path explicit.
- Do not call
connect()again when reusing an already-armed preflight driver. - Keep runtime startup semantics clear: reuse vs fresh initialization should be distinguishable in code and UI copy.
Notes
- This is separate from UI wording cleanup.
- Preflight still blocks launch if required laser verification fails.
- After launch, runtime fault handling remains a separate behavior question.
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from matiasandina/uid_python_api
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
file cleanupOpen
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
matiasandina/uid_python_api#14 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
matiasandina/uid_python_api#13 · 4 comments ·
All issues in matiasandina/uid_python_api
Similar issues
-
bug server
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sportsdataverse/sportsdataverse-py#641 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
googleapis/google-cloud-python#18532 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day