Commit graph

45 commits

Author SHA1 Message Date
Julian Stirling
59a5246904 Apply suggestions from code review of branch simplify-csm-interface
Co-authored-by: Joe Knapper <joe.knapper@glasgow.ac.uk>
2025-07-14 15:33:50 +00:00
Julian Stirling
b89449be77 Add camera-stage-mapping compliant functions to BaseStage and BaseCamera. 2025-07-13 21:55:55 +01:00
Julian Stirling
7e6017f648 Get codespell passing and add it as a CI job. 2025-07-11 00:16:25 +01:00
Julian Stirling
e33fecaef0 Documentation of python magic class methods 2025-07-10 16:46:10 +01:00
Julian Stirling
1bbbfeef0f Add docstrings to public methods 2025-07-10 14:04:48 +01:00
Julian Stirling
a30b726b91 Class docstrings 2025-07-10 13:27:41 +01:00
Julian Stirling
80beeea07b Add punctuation to docstrings 2025-07-10 09:24:50 +01:00
Julian Stirling
4dc41bb008 Single line summaries of docstrings 2025-07-10 09:24:49 +01:00
Julian Stirling
35d47fe3ed Starting docstring on the same lines as the quotations 2025-07-10 09:24:49 +01:00
Julian Stirling
f51dae7b3a Doc strings to imperative mood 2025-07-10 09:24:49 +01:00
Julian Stirling
a84a916719 Restructured text fixes so that pydoctor would return without an error 2025-07-09 23:59:08 +01:00
Julian Stirling
d9fd54696a Monkey patch Uvicorn's handle_exit function to stop streams
Before the uvicorn handle_exit function is called kill the camera
streams.
2025-07-09 16:53:08 +01:00
Julian Stirling
52a80ef66b And adjust for new as lt import 2025-07-07 15:25:14 +01:00
Julian Stirling
fc6c13f40e Apply suggestions from code review of branch fast-stack
Co-authored-by: Beth Probert <beth_probert@outlook.com>
2025-06-27 10:41:53 +00:00
Julian Stirling
05af5e7548 Write unit teasts for CameraMemoryBuffer and fix minor issues found 2025-06-26 22:49:09 +01:00
Julian Stirling
2aea6a2569 Docstrings and stop using Pydantic for ScanParameters 2025-06-26 19:46:25 +01:00
Julian Stirling
6a87805b47 Fixing a number of issues from the merge and refactor. 2025-06-26 18:29:12 +01:00
Julian Stirling
61dd5e4958 Compete first (untested) pass of trying to make fast stack compatible with new memory captures 2025-06-26 17:43:11 +01:00
Julian Stirling
0389ab760a Apply suggestions from code review of branch jpeg-capture-in-stacking
Co-authored-by: Joe Knapper <joe.knapper@glasgow.ac.uk>
2025-06-25 16:52:23 +00:00
Julian Stirling
83e0e08ccc Apply suggestions from code review of branch jpeg-capture-in-stacking
Co-authored-by: Beth Probert <beth_probert@outlook.com>
2025-06-25 15:12:28 +00:00
Julian Stirling
ce5b5b781c Add typehints and docstrings as suggested in review 2025-06-25 15:55:48 +01:00
Julian Stirling
0933ece63a Apply suggestions from code review of branch jpeg-capture-in-stacking
Co-authored-by: Beth Probert <beth_probert@outlook.com>
2025-06-25 15:39:36 +01:00
Julian Stirling
8a4ad49c03 Apply suggestions from code review of branch jpeg-capture-in-stacking
Co-authored-by: Richard Bowman <richard.bowman@cantab.net>
2025-06-25 09:17:32 +00:00
Julian Stirling
0e3f4305b5 Tidy post refactor of cameras 2025-06-23 11:26:24 +01:00
Julian Stirling
4368dc3d90 Consolidate functionality into BaseCamera from Capture Thing and StreamingPicamera2 2025-06-23 11:26:22 +01:00
Julian Stirling
b5606984ae Consolidate the BaseCamera, CameraStub, and CameraProtocol, move StreamingPiCamera2 to this repo 2025-06-23 11:25:49 +01:00
jaknapper
7052917ff9 capture_image in stub raises NotImplemented 2025-06-23 11:25:49 +01:00
jaknapper
8c8c6568c3 Updated docstring for start_streaming 2025-06-23 11:25:49 +01:00
jaknapper
2d946637eb Added buffer_count as an argument of streaming 2025-06-23 11:25:48 +01:00
jaknapper
968bd339c2 SETTLING_TIME global in stacking 2025-06-23 11:25:37 +01:00
jaknapper
744ec28f93 Get images as a PIL image from camera, use resizing and saving as settling time in stack 2025-06-23 11:19:20 +01:00
jaknapper
9f2a131f1e Swap stream for scan, target_resolution as arg 2025-06-23 11:17:46 +01:00
jaknapper
f5c1ff2621 Ruff formating 2025-06-23 11:17:46 +01:00
jaknapper
17f3bbe646 Low res stream during scanning for instant high res captures 2025-06-23 11:17:46 +01:00
jaknapper
a9fdd0ea3e Wait params in captures, multiple attempts to capture 2025-06-23 11:17:46 +01:00
jaknapper
8bc0573ab1 Capture_array can now use "full" stream 2025-06-23 11:17:46 +01:00
jaknapper
9d1385231d Rename jpeg_array to highres_array 2025-06-23 11:17:46 +01:00
jaknapper
26163dc97e Added a new way to capture full res JPEGs, need to do a comparison of results 2025-06-23 11:17:45 +01:00
jaknapper
a4801ad861 Update camera thing to match upstream 2025-05-07 19:52:21 +01:00
Richard Bowman
9fd8fc37f1 Formatted with Ruff 2024-12-03 06:46:08 +00:00
Richard Bowman
bccb1ee923 Stub class for camera protocol
As with the previous commit, this adds a concrete stub Thing to enable
DirectThingClient generation, so we
can depend on the camera.
2024-11-29 12:53:42 +00:00
Richard Bowman
2e2e877d75 JPEGBlob class definition
Static type checking is easier if JPEGBlob is declared as a class, rather than
being created with a function.
2024-11-29 12:19:05 +00:00
Richard Bowman
adbb805556 Formal Protocol for camera interface
I've now split the base camera code into a runtime-checkable Protocol
and a concrete base class (which is optional). This removes the requirement
for cameras to subclass `openflexure_microscope.things.camera.Camera`
and instead uses duck typing that should
work both statically and dynamically.

As part of this, I've moved the commonly-used dependencies
on the camera inside `openflexure_microscope.things.camera` for consistency, and to make it easy to update them if it changes in the future.
2024-11-29 11:26:38 +00:00
Richard Bowman
1ba799de22 Migrate to new Blob type and update imports
This now uses the latest version of labthings-fastapi.
2024-11-28 17:35:56 +00:00
Richard Bowman
2268425bf3 Depend only on generic Camera and Stage
I've now defined parent classes for camera and stage, and depend only on those. This allows
proper typing while enabling the actual hardware
classes to be swapped.

The interfaces definitely aren't final - this is a first
draft, largely to enable me to test out the concept
of a configuration server.
2024-08-09 02:41:39 +01:00