From e3031370317af66da4bbb5154c2f04952b4e0b24 Mon Sep 17 00:00:00 2001 From: Antoine Weisrock Date: Wed, 30 Oct 2024 18:33:01 +0100 Subject: [PATCH] docs: forgot a few files in 9e80a8c4 --- src/crappy/actuator/__init__.py | 4 +--- src/crappy/blocks/generator_path/integrator.py | 4 ++-- src/crappy/blocks/generator_path/meta_path/path.py | 5 +++-- src/crappy/camera/__init__.py | 4 +--- src/crappy/inout/__init__.py | 4 +--- src/crappy/modifier/__init__.py | 4 +--- 6 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/crappy/actuator/__init__.py b/src/crappy/actuator/__init__.py index cddf4745..b1b8df90 100644 --- a/src/crappy/actuator/__init__.py +++ b/src/crappy/actuator/__init__.py @@ -1,7 +1,5 @@ # coding: utf-8 -from typing import Dict, Type - from .adafruit_dc_motor_hat import DCMotorHat from .fake_dc_motor import FakeDCMotor from .fake_stepper_motor import FakeStepperMotor @@ -18,4 +16,4 @@ from .meta_actuator import MetaActuator, Actuator from ._deprecated import deprecated_actuators -actuator_dict: Dict[str, Type[Actuator]] = MetaActuator.classes +actuator_dict: dict[str, type[Actuator]] = MetaActuator.classes diff --git a/src/crappy/blocks/generator_path/integrator.py b/src/crappy/blocks/generator_path/integrator.py index 8f3b7cd0..37c073cf 100644 --- a/src/crappy/blocks/generator_path/integrator.py +++ b/src/crappy/blocks/generator_path/integrator.py @@ -1,7 +1,7 @@ # coding: utf-8 from numpy import trapz -from typing import Union, Dict +from typing import Union import logging from .meta_path import Path, ConditionType @@ -69,7 +69,7 @@ def __init__(self, self._last_t = None self._last_val = None - def get_cmd(self, data: Dict[str, list]) -> float: + def get_cmd(self, data: dict[str, list]) -> float: """Gets the latest values of the incoming label, integrates them and changes the output accordingly. diff --git a/src/crappy/blocks/generator_path/meta_path/path.py b/src/crappy/blocks/generator_path/meta_path/path.py index 31cbbffe..a8f7bb5b 100644 --- a/src/crappy/blocks/generator_path/meta_path/path.py +++ b/src/crappy/blocks/generator_path/meta_path/path.py @@ -1,14 +1,15 @@ # coding: utf-8 from time import time, sleep -from typing import Callable, Union, Dict, Optional +from typing import Union, Optional +from collections.abc import Callable from re import split, IGNORECASE, match import logging from multiprocessing import current_process from .meta_path import MetaPath -ConditionType = Callable[[Dict[str, list]], bool] +ConditionType = Callable[[dict[str, list]], bool] class Path(metaclass=MetaPath): diff --git a/src/crappy/camera/__init__.py b/src/crappy/camera/__init__.py index d5bbc28a..888e121c 100644 --- a/src/crappy/camera/__init__.py +++ b/src/crappy/camera/__init__.py @@ -1,7 +1,5 @@ # coding: utf-8 -from typing import Dict, Type - from .fake_camera import FakeCamera from .file_reader import FileReader from .opencv_camera_webcam import Webcam @@ -30,4 +28,4 @@ from .opencv_camera_basic import CameraOpencv from ._deprecated import deprecated_cameras -camera_dict: Dict[str, Type[Camera]] = MetaCamera.classes +camera_dict: dict[str, type[Camera]] = MetaCamera.classes diff --git a/src/crappy/inout/__init__.py b/src/crappy/inout/__init__.py index 5f800c8e..c86ec9e2 100644 --- a/src/crappy/inout/__init__.py +++ b/src/crappy/inout/__init__.py @@ -1,7 +1,5 @@ # coding: utf-8 -from typing import Dict, Type - from .ads1115 import ADS1115 from .agilent_34420A import Agilent34420a from .comedi import Comedi @@ -36,4 +34,4 @@ # All the inout objects from ._deprecated import deprecated_inouts -inout_dict: Dict[str, Type[InOut]] = MetaIO.classes +inout_dict: dict[str, type[InOut]] = MetaIO.classes diff --git a/src/crappy/modifier/__init__.py b/src/crappy/modifier/__init__.py index 7e990683..682fbdc3 100644 --- a/src/crappy/modifier/__init__.py +++ b/src/crappy/modifier/__init__.py @@ -1,7 +1,5 @@ # coding: utf-8 -from typing import Dict, Type - from .meta_modifier import Modifier, MetaModifier from .demux import Demux @@ -18,4 +16,4 @@ from ._deprecated import Moving_avg, Moving_med, Trig_on_change, Trig_on_value -modifier_dict: Dict[str, Type[Modifier]] = MetaModifier.classes +modifier_dict: dict[str, type[Modifier]] = MetaModifier.classes