Repository navigation
Cookbook camera recipe on the camera base class of pymodaq_plugins_utils - #28
Merged
Merged
Conversation
CookbookCamera is the camera plugin written on CameraBase: it only creates its driver, the base class does the acquisition thread, the ROI drawn in the viewer applied by the camera, the binning, the exposure and the axes in um. The driver, MockCamera, follows CameraDriverBase (the methods of the pylablib cameras) and has its own thread and buffer like a real one, so it can be copied to write the driver of a camera that pylablib does not drive. The package depends on pymodaq_plugins_utils (the release that has CameraBase). The README sentence that said each recipe is an actuator and a 0D detector is corrected. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg
Contributor
Author
|
The red checks ( Generated by Claude Code |
seb5g
marked this pull request as ready for review
October 26, 2026 20:49
…s in the tests Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg
…a no longer give a DataND) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tdiso1u1ZhikSutj2Qs5Cg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Before: the camera recipe was
BSCamera, which shows what a camera gives its plugin (ROI, binning, exposure, axes in µm) but does the readout inside the plugin. Nothing showed how a real driver integrates: a thread of its own filling a buffer, the plugin waiting for the frames, the ROI drawn in the viewer applied by the camera.After:
CookbookCamerais the camera plugin written onCameraBaseofpymodaq_plugins_utils(PyMoDAQ/pymodaq_plugins_utils#11): it only creates its driver.MockCamera(hardware/mock_camera.py) follows the driver contractCameraDriverBaseand behaves like a real one: its own acquisition thread, a ring buffer,wait_for_framewith a timeout,read_multiple_images, ROI and binning that cannot change while the acquisition runs, 16-bit counts with shot noise, a pixel size so the axes are in µm. Copy it to write the driver of a camera that pylablib does not drive.BSCameraandRoiStuffare kept.What changes: the new plugin, driver and tests (
tests/test_cookbook_camera.py, 17 tests: buffer semantics of the driver, snap, average, live, ROI from the viewer, binning, clear ROI, a ROI change during live, close), the README table and setups,CONTEXT.md, and the sentence of the cookbook intro saying each recipe is an actuator and a 0D detector. The package now depends onpymodaq_plugins_utils>=5.3.1.How: the full suite passes locally (188 passed, 3 skipped) with the branch of pymodaq_plugins_utils#11 on the path, and
check_pluginis ok. This PR is a draft until that PR is merged and released (the floor5.3.1has to be the release number). Everything is simulated: nothing was tried on a real camera.Generated by Claude Code