diff --git a/scripts/python/PyAutoscoper/connect.py b/scripts/python/PyAutoscoper/connect.py index af21daff..b62c1276 100644 --- a/scripts/python/PyAutoscoper/connect.py +++ b/scripts/python/PyAutoscoper/connect.py @@ -39,7 +39,7 @@ def __str__(self) -> str: class AutoscoperServerVersionMismatch(Exception): """Exception raised when the client attempt to connect to an unsupported server.""" - def __init__(self, server_version: int): + def __init__(self, server_version: int) -> None: self.server_version = server_version msg = f"server_version {self.server_version}, expected_version {EXPECTED_SERVER_VERSION}" super().__init__(msg) @@ -159,7 +159,7 @@ def _openConnection(self) -> socket.socket: s.connect((self.address, 30007)) return s - def _checkVersion(self): + def _checkVersion(self) -> None: """ Internal function, should not be called by a user. @@ -191,7 +191,7 @@ def is_connected(self) -> bool: except (AutoscoperServerError, AutoscoperConnectionError): return False - def loadTrial(self, trial_file: str): + def loadTrial(self, trial_file: str) -> None: """ Load a trial file into the PyAutoscoper server. @@ -216,7 +216,7 @@ def loadTrackingData( is_cm: bool = False, is_rad: bool = False, interpolate: bool = False, - ): + ) -> None: """ Load tracking data into the PyAutoscoper server. @@ -271,7 +271,7 @@ def saveTracking( convert_to_cm: bool = False, convert_to_rad: bool = False, interpolate: bool = False, - ): + ) -> None: """ Save tracking data from the PyAutoscoper server. @@ -315,7 +315,7 @@ def saveTracking( tracking_file, ) - def loadFilters(self, camera: int, settings_file: str): + def loadFilters(self, camera: int, settings_file: str) -> None: """ Load filter settings into the PyAutoscoper server. @@ -332,7 +332,7 @@ def loadFilters(self, camera: int, settings_file: str): raise AutoscoperServerError(f"Filter settings not found: {settings_file}") self._send_command(0x04, camera, settings_file) - def setFrame(self, frame: int): + def setFrame(self, frame: int) -> None: """ Set the frame to be used for the next acquisition. @@ -370,7 +370,7 @@ def getPose(self, volume: int, frame: int) -> list[float]: struct.unpack("d", response[41:49])[0], ] - def setPose(self, volume: int, frame: int, pose: list[float]): + def setPose(self, volume: int, frame: int, pose: list[float]) -> None: """ Set the pose of the volume at the specified frame. @@ -409,7 +409,7 @@ def getNCC(self, volume: int, pose: list[float]) -> list[float]: ncc.append(struct.unpack("d", val)[0]) return ncc - def setBackground(self, threshold: float): + def setBackground(self, threshold: float) -> None: """ Set the background threshold. @@ -458,7 +458,7 @@ def optimizeFrame( opt_method: OptimizationMethod, cf_model: CostFunction, opt_init_heuristic: OptimizationInitializationHeuristic, - ): + ) -> None: """ Optimize the pose of the volume at the specified frame. @@ -521,7 +521,7 @@ def optimizeFrame( opt_init_heuristic.value, ) - def saveFullDRR(self): + def saveFullDRR(self) -> None: """ Save the full DRR. @@ -530,7 +530,7 @@ def saveFullDRR(self): """ self._send_command(0x0C) # 12 - def closeConnection(self): + def closeConnection(self) -> None: """ Close the connection to the server. @@ -559,7 +559,7 @@ def trackingDialog( opt_method: OptimizationMethod = OptimizationMethod.PARTICLE_SWARM_OPTIMIZATION, cf_model: CostFunction = CostFunction.NORMALIZED_CROSS_CORRELATION, opt_init_heuristic: OptimizationInitializationHeuristic = OptimizationInitializationHeuristic.PREVIOUS_FRAME, - ): + ) -> None: """ Automatically tracks the volume across the given frames. diff --git a/scripts/python/pyproject.toml b/scripts/python/pyproject.toml index 8c011b98..94798136 100644 --- a/scripts/python/pyproject.toml +++ b/scripts/python/pyproject.toml @@ -67,7 +67,6 @@ extend-ignore = [ target-version = "py38" line-length = 120 flake8-annotations.suppress-dummy-args = true -flake8-annotations.suppress-none-returning = true isort.known-first-party = [ "PyAutoscoper", ]