Skip to content

Commit

Permalink
fix: fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fdrgsp committed Nov 4, 2024
1 parent f26f431 commit 9b1c6f9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/pymmcore_widgets/mda/_core_positions.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,16 +390,16 @@ def _on_selection_change(self) -> None:
# if 'af_per_position' is not checked and the autofocus was not locked
# before moving, we do not use autofocus.
if table_af_offset is not None or af_offset is not None:
self._mmc.setAutoFocusOffset(
table_af_offset if table_af_offset is not None else af_offset
)
try:
self._mmc.enableContinuousFocus(False)
self._perform_autofocus()
self._mmc.enableContinuousFocus(af_engaged)
self._mmc.waitForSystem()
except RuntimeError as e:
logger.warning("Hardware autofocus failed. %s", e)
_af = table_af_offset if table_af_offset is not None else af_offset
if _af is not None:
self._mmc.setAutoFocusOffset(_af)
try:
self._mmc.enableContinuousFocus(False)
self._perform_autofocus()
self._mmc.enableContinuousFocus(af_engaged)
self._mmc.waitForSystem()
except RuntimeError as e:
logger.warning("Hardware autofocus failed. %s", e)

Check warning on line 402 in src/pymmcore_widgets/mda/_core_positions.py

View check run for this annotation

Codecov / codecov/patch

src/pymmcore_widgets/mda/_core_positions.py#L393-L402

Added lines #L393 - L402 were not covered by tests

self._mmc.waitForSystem()

Expand Down

0 comments on commit 9b1c6f9

Please sign in to comment.