Skip to content

Conversation

@AdvancedImagingUTSW
Copy link
Collaborator

Use safe dict .get lookups in GUI controllers to avoid KeyError when nested settings are missing. Introduce Microscope.cache_stage_positions and set_stage_position_cache_policy(image_mode) to enable caching of stage positions for z-stack/customized modes, reducing repeated config lookups and per-step overhead. Wire policy application in Model during initialization and update tests to call the policy setter and assert caching behavior. Also add AGENTS.md with project notes and developer workflows.

Use safe dict .get lookups in GUI controllers to avoid KeyError when nested settings are missing. Introduce Microscope.cache_stage_positions and set_stage_position_cache_policy(image_mode) to enable caching of stage positions for z-stack/customized modes, reducing repeated config lookups and per-step overhead. Wire policy application in Model during initialization and update tests to call the policy setter and assert caching behavior. Also add AGENTS.md with project notes and developer workflows.
@AdvancedImagingUTSW AdvancedImagingUTSW linked an issue Feb 3, 2026 that may be closed by this pull request
@AdvancedImagingUTSW
Copy link
Collaborator Author

@conorhughmcfadden - Could you test this branch and see if you can now achieve something closer to 100 Hz?

Mark test_single_acquisition as flaky with reruns to reduce CI flakes; handle camera batch responses that return lists by counting frames from list lengths (rename variables to n_frames_expected and n_framed_received). Move initial image recv handling, add a max_iters safety counter to avoid infinite loops, and update the final assertion to compare counted frames to expected. Also apply a minor formatting fix to the multiposition test input list spacing.
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 52.51%. Comparing base (f320adb) to head (54c821c).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
src/navigate/model/microscope.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1172      +/-   ##
===========================================
- Coverage    52.51%   52.51%   -0.01%     
===========================================
  Files          197      197              
  Lines        23968    23976       +8     
===========================================
+ Hits         12586    12590       +4     
- Misses       11382    11386       +4     
Flag Coverage Δ
unittests 52.51% <90.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AdvancedImagingUTSW AdvancedImagingUTSW merged commit 56b9a0c into develop Feb 3, 2026
1 check passed
TrungNguyenDuc pushed a commit to TrungNguyenDuc/navigate that referenced this pull request Feb 6, 2026
* Add stage position caching and safe config access

Use safe dict .get lookups in GUI controllers to avoid KeyError when nested settings are missing. Introduce Microscope.cache_stage_positions and set_stage_position_cache_policy(image_mode) to enable caching of stage positions for z-stack/customized modes, reducing repeated config lookups and per-step overhead. Wire policy application in Model during initialization and update tests to call the policy setter and assert caching behavior. Also add AGENTS.md with project notes and developer workflows.

* Update microscope.py

* Improve robustness of test_single_acquisition

Mark test_single_acquisition as flaky with reruns to reduce CI flakes; handle camera batch responses that return lists by counting frames from list lengths (rename variables to n_frames_expected and n_framed_received). Move initial image recv handling, add a max_iters safety counter to avoid infinite loops, and update the final assertion to compare counted frames to expected. Also apply a minor formatting fix to the multiposition test input list spacing.
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.

Avoid Repetitive Proxy Dict Calls

2 participants