Add ANN002, and ANN003 rules

This commit is contained in:
Julian Stirling 2025-08-27 13:33:11 +01:00
parent 24233412af
commit d673196671
6 changed files with 11 additions and 11 deletions

View file

@ -252,7 +252,7 @@ class JPEGSharpnessMonitor:
finally:
self.running = False
def focus_rel(self, dz: int, **kwargs) -> tuple[int, int]:
def focus_rel(self, dz: int, block_cancellation: int = False) -> tuple[int, int]:
"""Move the stage by dz, monitoring the position over time.
This performs exactly one move. Multiple calls of this method
@ -268,7 +268,7 @@ class JPEGSharpnessMonitor:
self.stage_positions.append(self.stage.position)
# Main move
self.stage.move_relative(z=dz, **kwargs)
self.stage.move_relative(z=dz, block_cancellation=block_cancellation)
# Store the end time and position
self.stage_times.append(time.time())

View file

@ -2,7 +2,7 @@
from __future__ import annotations
from typing import Optional
from typing import Optional, Any
from types import TracebackType
from collections.abc import Mapping
import time
@ -19,7 +19,7 @@ class DummyStage(BaseStage):
hardware attached.
"""
def __init__(self, step_time: float = 0.001, **kwargs):
def __init__(self, step_time: float = 0.001, **kwargs: Any):
"""Initialise the Dummy stage, setting the step_time to adjust the speed.
:param step_time: The time in seconds per "motor" step. The default of 0.001

View file

@ -5,7 +5,7 @@ import logging
import threading
import time
from copy import copy
from typing import Iterator, Literal, Optional
from typing import Iterator, Literal, Optional, Any
from types import TracebackType
from contextlib import contextmanager
from collections.abc import Mapping
@ -25,7 +25,7 @@ class SangaboardThing(BaseStage):
functionality is accessed by directly querying the serial interface.
"""
def __init__(self, port: str = None, **kwargs):
def __init__(self, port: str = None, **kwargs: Any):
"""Initialise SangaboardThing.
Initialise the "Thing", but do not initialise an underlying