Apply suggestions from code review of branch update-for-labthings0.0.12

Co-authored-by: Richard Bowman <richard.bowman@cantab.net>
This commit is contained in:
Julian Stirling 2025-12-16 13:23:03 +00:00
parent a67afdf21f
commit ddc81f9c17
2 changed files with 2 additions and 8 deletions

View file

@ -71,8 +71,7 @@ class PicameraStreamOutput(Output):
def __init__(self, stream: lt.outputs.MJPEGStream) -> None: def __init__(self, stream: lt.outputs.MJPEGStream) -> None:
"""Create an output that puts frames in an MJPEGStream. """Create an output that puts frames in an MJPEGStream.
We need to pass the stream object, because new frame notifications happen in :param stream: The labthings MJPEGStream to send frames to.
the anyio event loop and frames are sent from a thread.
""" """
Output.__init__(self) Output.__init__(self)
self.stream = stream self.stream = stream
@ -182,7 +181,7 @@ class StreamingPiCamera2(BaseCamera):
"""Override save_settings to ensure that camera properties don't recurse. """Override save_settings to ensure that camera properties don't recurse.
This method is run by any Thing when a setting is saved. However, the This method is run by any Thing when a setting is saved. However, the
method reads the thing_setting. As reading the thing setting talks to the method reads the setting. As reading the setting talks to the
camera and calls save_settings if the value is not as expected, this could camera and calls save_settings if the value is not as expected, this could
cause recursion. Also this means that saving one setting causes all others cause recursion. Also this means that saving one setting causes all others
to be read each time. to be read each time.

View file

@ -288,11 +288,6 @@ def test_move_absolute(dummy_stage, path):
3 paths are tried for each case of axis inversion. This checks both that the 3 paths are tried for each case of axis inversion. This checks both that the
reported position changes as is input in path, and that the hardware position is reported position changes as is input in path, and that the hardware position is
inverted when appropriate. inverted when appropriate.
NOTE: it is essential that `dummy_stage` is imported even if any time it is used
dummy stage could be used. This is because the fixture that creates stage client
handles adding the dummy_stage to a server. It needs to have been added to a
server for it not to throw errors about not being connected to a server.
""" """
# Note that the fixture is not reset. This is fine, because the stage_should work # Note that the fixture is not reset. This is fine, because the stage_should work
# no matter the starting position. # no matter the starting position.