From ea3de5f45d268baa509adcbab1de973adc8a32d1 Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Tue, 17 Feb 2026 17:56:26 +0000 Subject: [PATCH] Apply suggestions from code review of branch jogging Co-authored-by: Joe Knapper --- src/openflexure_microscope_server/things/stage/__init__.py | 4 ++-- src/openflexure_microscope_server/things/stage/dummy.py | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/openflexure_microscope_server/things/stage/__init__.py b/src/openflexure_microscope_server/things/stage/__init__.py index 7d92854c..2c06eaf3 100644 --- a/src/openflexure_microscope_server/things/stage/__init__.py +++ b/src/openflexure_microscope_server/things/stage/__init__.py @@ -38,7 +38,7 @@ class JogCommand: def __init__(self, displacement: Optional[Sequence[int]]) -> None: """Initialise a JogCommand. - :param displacement: The distances as a sequence of the move for each axis. + :param displacement: The distances as a sequence of moves for each axis. None for stop motion. """ super().__init__() @@ -347,7 +347,7 @@ class BaseStage(lt.Thing): if not self._poll_moving(): # The stage is no longer moving, return None return None - # If we reached here then the stage is still moving shorten timeout and + # If we reached here then the stage is still moving. Shorten timeout and # check again. timeout = 0.1 diff --git a/src/openflexure_microscope_server/things/stage/dummy.py b/src/openflexure_microscope_server/things/stage/dummy.py index a73bd724..3b1aaf0a 100644 --- a/src/openflexure_microscope_server/things/stage/dummy.py +++ b/src/openflexure_microscope_server/things/stage/dummy.py @@ -88,10 +88,7 @@ class DummyStage(BaseStage): def _set_pos_during_move( self, displacement: Sequence[int], fraction_complete: float ) -> None: - """Set the instantaneous position from the fraction through a move. - - If this is the final set, also update hardware position - """ + """Set the instantaneous position based on the completed fraction of an ongoing move.""" self.instantaneous_position = { ax: self._hardware_position[ax] + int(fraction_complete * disp) for ax, disp in zip(self.axis_names, displacement, strict=True)