Skip to content

Commit d87d79d

Browse files
authored
Remove unnecessary sleep and add performance TODO (#1158)
* Remove unnecessary sleep and add performance TODO Removed a redundant time.sleep call in SyntheticStage's move_absolute method to improve performance. Added a TODO comment in Microscope to highlight the cost of repeated dictionary lookups for image_mode during z-stack acquisition, suggesting future optimization. * Update synthetic.py
1 parent c981426 commit d87d79d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/navigate/model/devices/stage/synthetic.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ def move_axis_absolute(
125125
if axis_abs == -1e50:
126126
return False
127127

128-
if wait_until_done:
129-
time.sleep(0.025)
130-
131128
# Move the stage
132129
setattr(self, f"{axis}_pos", axis_abs)
133130
return True
@@ -157,8 +154,6 @@ def move_absolute(
157154

158155
for axis in abs_pos_dict:
159156
setattr(self, f"{axis}_pos", abs_pos_dict[axis])
160-
if wait_until_done is True:
161-
time.sleep(0.025)
162157

163158
return True
164159

‎src/navigate/model/microscope.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,11 @@ def move_stage(
892892
success : bool
893893
True if stage is successfully moved, False otherwise.
894894
"""
895+
896+
# TODO: Calling the proxy dictionary costs ~3 ms, and is performed for every step
897+
# in the z-stack. To optimize performance, we should retrieve the image mode
898+
# once and avoid repeated dictionary lookups.
899+
895900
if self.configuration["experiment"]["MicroscopeState"]["image_mode"] in (
896901
"z-stack",
897902
"customized",

0 commit comments

Comments
 (0)