diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 1c6570733619..49c360e6c42c 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -29,10 +29,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python-version: ["3.11", "3.12", "3.13", "3.14"] + python-version: ["3.12", "3.13", "3.14"] exclude: - - os: windows-latest - python-version: 3.11 - os: windows-latest python-version: 3.13 - os: windows-latest @@ -122,7 +120,7 @@ jobs: - name: Download artifact uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - name: docs_3.11_ubuntu-latest + name: docs_3.12_ubuntu-latest path: build_docs - name: Deploy to gh pages diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index bacf81d1c720..919c2dc5fd8a 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -30,17 +30,13 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python-version: ["3.11", "3.12", "3.13", "3.14"] + python-version: ["3.12", "3.13", "3.14"] min-version: [false] include: - os: ubuntu-latest - python-version: "3.11" + python-version: "3.12" min-version: true exclude: - - os: ubuntu-latest - python-version: "3.11" - - os: windows-latest - python-version: "3.11" - os: windows-latest python-version: "3.13" - os: windows-latest diff --git a/.github/workflows/upload_to_pypi.yaml b/.github/workflows/upload_to_pypi.yaml index 7dbceac2eb69..5dace54a64b0 100644 --- a/.github/workflows/upload_to_pypi.yaml +++ b/.github/workflows/upload_to_pypi.yaml @@ -25,7 +25,7 @@ jobs: - name: Set up Python uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: - python-version: '3.11' + python-version: '3.12' - name: Install build deps run: pip install --upgrade pip setuptools wheel build - name: Build diff --git a/docs/examples/writing_drivers/A-ParameterWithSetpoints-Example-with-Dual-Setpoints.ipynb b/docs/examples/writing_drivers/A-ParameterWithSetpoints-Example-with-Dual-Setpoints.ipynb index 01d616181a51..038b144185a4 100644 --- a/docs/examples/writing_drivers/A-ParameterWithSetpoints-Example-with-Dual-Setpoints.ipynb +++ b/docs/examples/writing_drivers/A-ParameterWithSetpoints-Example-with-Dual-Setpoints.ipynb @@ -21,7 +21,7 @@ "from typing import TYPE_CHECKING\n", "\n", "if TYPE_CHECKING:\n", - " from typing_extensions import Unpack\n", + " from typing import Unpack\n", "\n", "import numpy as np\n", "import numpy.typing as npt\n", diff --git a/docs/examples/writing_drivers/Creating-Instrument-Drivers.ipynb b/docs/examples/writing_drivers/Creating-Instrument-Drivers.ipynb index ed0e65d11955..62d7174e64c8 100644 --- a/docs/examples/writing_drivers/Creating-Instrument-Drivers.ipynb +++ b/docs/examples/writing_drivers/Creating-Instrument-Drivers.ipynb @@ -21,9 +21,7 @@ "from typing import TYPE_CHECKING, Any\n", "\n", "if TYPE_CHECKING:\n", - " from typing_extensions import (\n", - " Unpack, # can be imported from typing if python >= 3.12\n", - " )\n", + " from typing import Unpack\n", "\n", "import numpy as np\n", "\n", diff --git a/docs/examples/writing_drivers/Creating-Simulated-PyVISA-Instruments.ipynb b/docs/examples/writing_drivers/Creating-Simulated-PyVISA-Instruments.ipynb index 69cbec180a4c..03a841739330 100644 --- a/docs/examples/writing_drivers/Creating-Simulated-PyVISA-Instruments.ipynb +++ b/docs/examples/writing_drivers/Creating-Simulated-PyVISA-Instruments.ipynb @@ -74,7 +74,7 @@ "from qcodes.instrument.visa import VisaInstrument, VisaInstrumentKWArgs\n", "\n", "if TYPE_CHECKING:\n", - " from typing_extensions import Unpack\n", + " from typing import Unpack\n", "\n", "\n", "class Weinschel8320(VisaInstrument):\n", diff --git a/pyproject.toml b/pyproject.toml index e32615e6e03b..7c8c57fba7ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", @@ -21,20 +20,20 @@ classifiers = [ ] license = "MIT" readme = "README.rst" -requires-python = ">=3.11" +requires-python = ">=3.12" dependencies = [ "broadbean>=0.11.0", - "h5netcdf>=0.14.1", - "h5py>=3.8.0", + "h5netcdf>=1.3.0", + "h5py>=3.10.0", "ipywidgets>=8.0.0,<9.0.0", "ipykernel>=6.12.0", # implicitly required by ipywidgets >=8.0.5 "jsonschema>=4.9.0", - "matplotlib>=3.6.0", + "matplotlib>=3.8.0", "networkx>=3.1", - "numpy>=1.22.4", + "numpy>=1.26.0", "packaging>=20.0", - "pandas>=1.5.0", - "pyarrow>=11.0.0", # will become a requirement of pandas. Installing explicitly silences a warning + "pandas>=2.1.1", + "pyarrow>=14.0.0", # will become a requirement of pandas. Installing explicitly silences a warning "pyvisa>=1.11.0, <1.17.0", "ruamel.yaml>=0.16.0,!=0.16.6", "tabulate>=0.9.0", @@ -46,7 +45,7 @@ dependencies = [ "xarray>=2023.08.0", "cf_xarray>=0.8.4", "opentelemetry-api>=1.17.0", - "pillow>=9.2.0", + "pillow>=10.2.0", "dask>=2022.1.0", # we are making use of xarray features that requires dask implicitly ] @@ -99,7 +98,7 @@ docs = [ "furo>=2024.8.6", "sphinxcontrib-towncrier>=0.5.0a0", "towncrier>=24.8.0,<26.0.0", # sphinxcontrib-towncrier is likely to break with new versions - "scipy>=1.10.0", # examples using scipy + "scipy>=1.12.0", # examples using scipy "qcodes_loop>=0.1.1", # legacy dataset import examples "intersphinx_registry>=0.2603.16" ] @@ -218,7 +217,6 @@ markers = "serial" # and error on all other warnings filterwarnings = [ 'error', - 'ignore:open_binary is deprecated:DeprecationWarning', # pyvisa-sim deprecated in 3.11 un-deprecated in 3.12. Drop filter once we drop support for 3.11 'ignore:unclosed database in:ResourceWarning', # internal should be fixed 'ignore:unclosed\ bool: return self._get_after_set -class ArraySweep(AbstractSweep, Generic[T]): +class ArraySweep[T: np.generic](AbstractSweep): """ Sweep the values of a given array. diff --git a/src/qcodes/dataset/measurements.py b/src/qcodes/dataset/measurements.py index cb11a9246af3..4dea97cc95f0 100644 --- a/src/qcodes/dataset/measurements.py +++ b/src/qcodes/dataset/measurements.py @@ -18,7 +18,7 @@ from itertools import chain from numbers import Number from time import perf_counter, perf_counter_ns -from typing import TYPE_CHECKING, Any, TypeAlias, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast import numpy as np import numpy.typing as npt @@ -74,8 +74,8 @@ Callable[..., Any], MutableSequence[Any] | MutableMapping[Any, Any] ] -ParameterResultType: TypeAlias = tuple[ParameterBase, ValuesType] -DatasetResultDict: TypeAlias = dict[ParamSpecBase, npt.NDArray] +type ParameterResultType = tuple[ParameterBase, ValuesType] +type DatasetResultDict = dict[ParamSpecBase, npt.NDArray] class ParameterTypeError(Exception): diff --git a/src/qcodes/dataset/threading.py b/src/qcodes/dataset/threading.py index 34a9d9be8cda..5b29b8c2ce60 100644 --- a/src/qcodes/dataset/threading.py +++ b/src/qcodes/dataset/threading.py @@ -9,7 +9,7 @@ import logging from collections import defaultdict from functools import partial -from typing import TYPE_CHECKING, Protocol, TypeAlias, TypeVar +from typing import TYPE_CHECKING, Protocol, TypeVar from qcodes.utils import RespondingThread @@ -21,8 +21,8 @@ from qcodes.dataset.data_set_protocol import ValuesType from qcodes.parameters import ParamDataType, ParameterBase -ParamMeasT: TypeAlias = "ParameterBase | Callable[[], None]" -OutType: TypeAlias = "list[tuple[ParameterBase, ValuesType]]" +type ParamMeasT = "ParameterBase | Callable[[], None]" +type OutType = "list[tuple[ParameterBase, ValuesType]]" T = TypeVar("T") diff --git a/src/qcodes/extensions/_driver_test_case.py b/src/qcodes/extensions/_driver_test_case.py index 900ff16065fc..d5defd328b70 100644 --- a/src/qcodes/extensions/_driver_test_case.py +++ b/src/qcodes/extensions/_driver_test_case.py @@ -1,7 +1,7 @@ from __future__ import annotations import unittest -from typing import TYPE_CHECKING, Generic, TypeVar +from typing import TYPE_CHECKING, TypeVar if TYPE_CHECKING: from qcodes.instrument import Instrument @@ -28,7 +28,7 @@ T = TypeVar("T", bound="Instrument") -class DriverTestCase(unittest.TestCase, Generic[T]): +class DriverTestCase[T: "Instrument"](unittest.TestCase): # override this in a subclass driver: type[T] | None = None instrument: T diff --git a/src/qcodes/extensions/infer.py b/src/qcodes/extensions/infer.py index d22b4060fd6c..cc5596ac7bbd 100644 --- a/src/qcodes/extensions/infer.py +++ b/src/qcodes/extensions/infer.py @@ -225,7 +225,7 @@ def _merge_user_and_class_attrs( return set.union(set(alt_source_attrs), set(InferAttrs.known_attrs())) -def get_chain_links_of_type( +def get_chain_links_of_type[C: ParameterBase]( link_param_type: type[C] | tuple[type[C], ...], parameter: Parameter ) -> tuple[C, ...]: """Gets all parameters in a chain of linked parameters that match a given type""" @@ -237,7 +237,7 @@ def get_chain_links_of_type( return tuple(chain_links) -def get_sole_chain_link_of_type( +def get_sole_chain_link_of_type[C: ParameterBase]( link_param_type: type[C] | tuple[type[C], ...], parameter: Parameter ) -> C: """Gets the one parameter in a chain of linked parameters that matches a given type""" @@ -256,7 +256,7 @@ def get_sole_chain_link_of_type( return chain_links[0] -def get_parent_instruments_from_chain_of_type( +def get_parent_instruments_from_chain_of_type[TInstrument: InstrumentBase]( instrument_type: type[TInstrument] | tuple[type[TInstrument], ...], parameter: Parameter, ) -> tuple[TInstrument, ...]: @@ -272,7 +272,7 @@ def get_parent_instruments_from_chain_of_type( ) -def get_sole_parent_instrument_from_chain_of_type( +def get_sole_parent_instrument_from_chain_of_type[TInstrument: InstrumentBase]( instrument_type: type[TInstrument] | tuple[type[TInstrument], ...], parameter: Parameter, ) -> TInstrument: diff --git a/src/qcodes/instrument/channel.py b/src/qcodes/instrument/channel.py index 95baf3d91ca5..8cd63ff7a3db 100644 --- a/src/qcodes/instrument/channel.py +++ b/src/qcodes/instrument/channel.py @@ -22,9 +22,7 @@ from .instrument_base import InstrumentBase if TYPE_CHECKING: - from typing import Self - - from typing_extensions import Unpack + from typing import Self, Unpack from .instrument_base import InstrumentBaseKWArgs diff --git a/src/qcodes/instrument/instrument.py b/src/qcodes/instrument/instrument.py index 8f2c36b39618..e4cc68cb2316 100644 --- a/src/qcodes/instrument/instrument.py +++ b/src/qcodes/instrument/instrument.py @@ -14,9 +14,7 @@ from .instrument_meta import InstrumentMeta if TYPE_CHECKING: - from typing import Self - - from typing_extensions import Unpack + from typing import Self, Unpack from qcodes.logger.instrument_logger import InstrumentLoggerAdapter @@ -461,7 +459,7 @@ def ask_raw(self, cmd: str) -> str: ) -def find_or_create_instrument( +def find_or_create_instrument[T: "Instrument"]( instrument_class: type[T], name: str, *args: Any, diff --git a/src/qcodes/instrument/ip.py b/src/qcodes/instrument/ip.py index f0a426d2d852..28940d80f81e 100644 --- a/src/qcodes/instrument/ip.py +++ b/src/qcodes/instrument/ip.py @@ -11,8 +11,7 @@ if TYPE_CHECKING: from collections.abc import Sequence from types import TracebackType - - from typing_extensions import Unpack + from typing import Unpack from .instrument_base import InstrumentBaseKWArgs diff --git a/src/qcodes/instrument/visa.py b/src/qcodes/instrument/visa.py index 1556ab683274..db1eff0e976f 100644 --- a/src/qcodes/instrument/visa.py +++ b/src/qcodes/instrument/visa.py @@ -22,9 +22,7 @@ if TYPE_CHECKING: from collections.abc import Mapping, Sequence - from typing import NotRequired - - from typing_extensions import Unpack + from typing import NotRequired, Unpack from qcodes.parameters.parameter import Parameter diff --git a/src/qcodes/instrument_drivers/AimTTi/_AimTTi_PL_P.py b/src/qcodes/instrument_drivers/AimTTi/_AimTTi_PL_P.py index 21b6098be932..748053bdb155 100644 --- a/src/qcodes/instrument_drivers/AimTTi/_AimTTi_PL_P.py +++ b/src/qcodes/instrument_drivers/AimTTi/_AimTTi_PL_P.py @@ -12,7 +12,7 @@ from qcodes.parameters import Parameter, create_on_off_val_mapping if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack class NotKnownModel(Exception): diff --git a/src/qcodes/instrument_drivers/AlazarTech/ATS.py b/src/qcodes/instrument_drivers/AlazarTech/ATS.py index bba21e8424d6..b8b6b2d43155 100644 --- a/src/qcodes/instrument_drivers/AlazarTech/ATS.py +++ b/src/qcodes/instrument_drivers/AlazarTech/ATS.py @@ -6,7 +6,7 @@ import time import warnings from contextlib import contextmanager -from typing import TYPE_CHECKING, Any, Generic, TypeVar, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast import numpy as np import numpy.typing as npt @@ -20,8 +20,7 @@ if TYPE_CHECKING: from collections.abc import Iterator, Sequence - - from typing_extensions import Unpack + from typing import Unpack logger = logging.getLogger(__name__) @@ -828,7 +827,7 @@ def __del__(self) -> None: ) -class AcquisitionInterface(Generic[OutputType]): +class AcquisitionInterface[OutputType]: """ This class represents all choices that the end-user has to make regarding the data-acquisition. this class should be subclassed to program these @@ -904,7 +903,7 @@ def buffer_done_callback(self, buffers_completed: int) -> None: pass -class AcquisitionController(Instrument, AcquisitionInterface[Any], Generic[OutputType]): +class AcquisitionController[OutputType](Instrument, AcquisitionInterface[Any]): """ Compatibility class. The methods of :class:`AcquisitionController` have been extracted. This class is the base class fro AcquisitionInterfaces diff --git a/src/qcodes/instrument_drivers/AlazarTech/ats_api.py b/src/qcodes/instrument_drivers/AlazarTech/ats_api.py index ca0f814256d5..dacd569ab317 100644 --- a/src/qcodes/instrument_drivers/AlazarTech/ats_api.py +++ b/src/qcodes/instrument_drivers/AlazarTech/ats_api.py @@ -6,7 +6,7 @@ import ctypes from ctypes import POINTER -from typing import TYPE_CHECKING, Any, ClassVar, TypeAlias +from typing import TYPE_CHECKING, Any, ClassVar # `ParameterBase` is needed because users may pass instrument parameters # that originate from `Instrument.parameters` dictionary which is typed @@ -30,9 +30,9 @@ POINTER_c_long = Any -IntOrParam: TypeAlias = "int | Parameter" +type IntOrParam = "int | Parameter" # deprecated alias for backwards compatibility -int_or_param: TypeAlias = IntOrParam # noqa: PYI042 +type int_or_param = IntOrParam # noqa: PYI042 class AlazarATSAPI(WrappedDll): diff --git a/src/qcodes/instrument_drivers/AlazarTech/dll_wrapper.py b/src/qcodes/instrument_drivers/AlazarTech/dll_wrapper.py index 15ef43685039..97264d59a317 100644 --- a/src/qcodes/instrument_drivers/AlazarTech/dll_wrapper.py +++ b/src/qcodes/instrument_drivers/AlazarTech/dll_wrapper.py @@ -43,7 +43,7 @@ def _api_call_task( return retval -def _normalize_params(*args: T) -> list[T]: +def _normalize_params[T](*args: T) -> list[T]: args_out: list[T] = [] for arg in args: if isinstance(arg, ParameterBase): diff --git a/src/qcodes/instrument_drivers/AlazarTech/utils.py b/src/qcodes/instrument_drivers/AlazarTech/utils.py index 34904c0562e1..e5cf5fe7c656 100644 --- a/src/qcodes/instrument_drivers/AlazarTech/utils.py +++ b/src/qcodes/instrument_drivers/AlazarTech/utils.py @@ -16,7 +16,8 @@ class TraceParameter( - Parameter[ParameterDataTypeVar, "AlazarTechATS"], Generic[ParameterDataTypeVar] + Parameter[ParameterDataTypeVar, "AlazarTechATS"], + Generic[ParameterDataTypeVar], # noqa: UP046 -- Generic kept because multi-inheritance with type params is not yet supported ): """ A parameter that keeps track of if its value has been synced to diff --git a/src/qcodes/instrument_drivers/CopperMountain/_M5065.py b/src/qcodes/instrument_drivers/CopperMountain/_M5065.py index 69c03af2fed2..5b3ea77d8283 100644 --- a/src/qcodes/instrument_drivers/CopperMountain/_M5065.py +++ b/src/qcodes/instrument_drivers/CopperMountain/_M5065.py @@ -3,7 +3,7 @@ from ._M5xxx import CopperMountainM5xxx if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/CopperMountain/_M5180.py b/src/qcodes/instrument_drivers/CopperMountain/_M5180.py index 73e9fd57b664..bbba039b0c6a 100644 --- a/src/qcodes/instrument_drivers/CopperMountain/_M5180.py +++ b/src/qcodes/instrument_drivers/CopperMountain/_M5180.py @@ -3,7 +3,7 @@ from ._M5xxx import CopperMountainM5xxx if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/CopperMountain/_M5xxx.py b/src/qcodes/instrument_drivers/CopperMountain/_M5xxx.py index 976a859a297a..ec01042e8101 100644 --- a/src/qcodes/instrument_drivers/CopperMountain/_M5xxx.py +++ b/src/qcodes/instrument_drivers/CopperMountain/_M5xxx.py @@ -14,7 +14,7 @@ from qcodes.validators import Bool, Enum, Ints, Numbers if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack class CopperMountainM5xxx(VisaInstrument): diff --git a/src/qcodes/instrument_drivers/Galil/dmc_41x3.py b/src/qcodes/instrument_drivers/Galil/dmc_41x3.py index 5ff4d9407d9b..2caf442a3f3f 100644 --- a/src/qcodes/instrument_drivers/Galil/dmc_41x3.py +++ b/src/qcodes/instrument_drivers/Galil/dmc_41x3.py @@ -15,7 +15,7 @@ from qcodes.validators import Enum, Ints, Multiples if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/HP/HP_8133A.py b/src/qcodes/instrument_drivers/HP/HP_8133A.py index 69e8515d5c1b..e526b385acbc 100644 --- a/src/qcodes/instrument_drivers/HP/HP_8133A.py +++ b/src/qcodes/instrument_drivers/HP/HP_8133A.py @@ -4,7 +4,7 @@ from qcodes.validators import Numbers if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/HP/HP_83650A.py b/src/qcodes/instrument_drivers/HP/HP_83650A.py index 5885e3cb9eb3..cf655fcf7603 100644 --- a/src/qcodes/instrument_drivers/HP/HP_83650A.py +++ b/src/qcodes/instrument_drivers/HP/HP_83650A.py @@ -11,7 +11,7 @@ from qcodes.utils.deprecate import QCoDeSDeprecationWarning if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/HP/HP_8753D.py b/src/qcodes/instrument_drivers/HP/HP_8753D.py index 7818f8c769e8..72dc1f929f3c 100644 --- a/src/qcodes/instrument_drivers/HP/HP_8753D.py +++ b/src/qcodes/instrument_drivers/HP/HP_8753D.py @@ -9,7 +9,7 @@ from qcodes.parameters import ArrayParameter, ParamRawDataType if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/Harvard/Decadac.py b/src/qcodes/instrument_drivers/Harvard/Decadac.py index 36cf3ff5f99f..764992cee531 100644 --- a/src/qcodes/instrument_drivers/Harvard/Decadac.py +++ b/src/qcodes/instrument_drivers/Harvard/Decadac.py @@ -11,7 +11,7 @@ ) if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/Keithley/Keithley_2000.py b/src/qcodes/instrument_drivers/Keithley/Keithley_2000.py index 3d30cc36b37a..eeb3f884d3f6 100644 --- a/src/qcodes/instrument_drivers/Keithley/Keithley_2000.py +++ b/src/qcodes/instrument_drivers/Keithley/Keithley_2000.py @@ -6,8 +6,7 @@ if TYPE_CHECKING: from collections.abc import Callable - - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/Keithley/Keithley_2400.py b/src/qcodes/instrument_drivers/Keithley/Keithley_2400.py index 8dd162b4907b..a3956ad0f130 100644 --- a/src/qcodes/instrument_drivers/Keithley/Keithley_2400.py +++ b/src/qcodes/instrument_drivers/Keithley/Keithley_2400.py @@ -5,7 +5,7 @@ from qcodes.validators import Enum, Strings if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/Keithley/Keithley_2450.py b/src/qcodes/instrument_drivers/Keithley/Keithley_2450.py index 2ce7877968a5..9167ce3c13b1 100644 --- a/src/qcodes/instrument_drivers/Keithley/Keithley_2450.py +++ b/src/qcodes/instrument_drivers/Keithley/Keithley_2450.py @@ -1,8 +1,8 @@ -from typing import TYPE_CHECKING, Any, ClassVar, Self, cast +from typing import TYPE_CHECKING, Any, ClassVar, Self, Unpack, cast import numpy as np import numpy.typing as npt -from typing_extensions import TypedDict, Unpack +from typing_extensions import TypedDict from qcodes.instrument import InstrumentChannel, VisaInstrument, VisaInstrumentKWArgs from qcodes.parameters import ( diff --git a/src/qcodes/instrument_drivers/Keithley/Keithley_3706A.py b/src/qcodes/instrument_drivers/Keithley/Keithley_3706A.py index a359685e5784..96c68ee3183d 100644 --- a/src/qcodes/instrument_drivers/Keithley/Keithley_3706A.py +++ b/src/qcodes/instrument_drivers/Keithley/Keithley_3706A.py @@ -10,7 +10,7 @@ from qcodes.parameters import Parameter, create_on_off_val_mapping if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack class Keithley3706AUnknownOrEmptySlot(Exception): diff --git a/src/qcodes/instrument_drivers/Keithley/Keithley_6500.py b/src/qcodes/instrument_drivers/Keithley/Keithley_6500.py index 3f184c0f738e..bccb7a49ec62 100644 --- a/src/qcodes/instrument_drivers/Keithley/Keithley_6500.py +++ b/src/qcodes/instrument_drivers/Keithley/Keithley_6500.py @@ -6,8 +6,7 @@ if TYPE_CHECKING: from collections.abc import Callable - - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/Keithley/Keithley_7510.py b/src/qcodes/instrument_drivers/Keithley/Keithley_7510.py index b678f697058c..b45b87504149 100644 --- a/src/qcodes/instrument_drivers/Keithley/Keithley_7510.py +++ b/src/qcodes/instrument_drivers/Keithley/Keithley_7510.py @@ -22,8 +22,7 @@ if TYPE_CHECKING: from collections.abc import Sequence from types import TracebackType - - from typing_extensions import Unpack + from typing import Unpack class DataArray7510(MultiParameter): diff --git a/src/qcodes/instrument_drivers/Keithley/Keithley_s46.py b/src/qcodes/instrument_drivers/Keithley/Keithley_s46.py index 11b7901dc3a4..07f501d07d3b 100644 --- a/src/qcodes/instrument_drivers/Keithley/Keithley_s46.py +++ b/src/qcodes/instrument_drivers/Keithley/Keithley_s46.py @@ -13,7 +13,7 @@ from qcodes.parameters import Parameter, ParamRawDataType if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack class KeithleyS46LockAcquisitionError(Exception): diff --git a/src/qcodes/instrument_drivers/Keithley/_Keithley_2600.py b/src/qcodes/instrument_drivers/Keithley/_Keithley_2600.py index 1398beaa86a7..9bd887f447d6 100644 --- a/src/qcodes/instrument_drivers/Keithley/_Keithley_2600.py +++ b/src/qcodes/instrument_drivers/Keithley/_Keithley_2600.py @@ -26,9 +26,9 @@ if TYPE_CHECKING: from collections.abc import Sequence + from typing import Unpack from qcodes_loop.data.data_set import DataSet - from typing_extensions import Unpack log = logging.getLogger(__name__) diff --git a/src/qcodes/instrument_drivers/Keysight/Infiniium.py b/src/qcodes/instrument_drivers/Keysight/Infiniium.py index 9c579b00d370..0c87fd4e8d4a 100644 --- a/src/qcodes/instrument_drivers/Keysight/Infiniium.py +++ b/src/qcodes/instrument_drivers/Keysight/Infiniium.py @@ -32,8 +32,7 @@ if TYPE_CHECKING: from collections.abc import Sequence - - from typing_extensions import Unpack + from typing import Unpack class DSOTimeAxisParam(Parameter): diff --git a/src/qcodes/instrument_drivers/Keysight/KeysightAgilent_33XXX.py b/src/qcodes/instrument_drivers/Keysight/KeysightAgilent_33XXX.py index 1a6a7cf5b704..50f2cb901a16 100644 --- a/src/qcodes/instrument_drivers/Keysight/KeysightAgilent_33XXX.py +++ b/src/qcodes/instrument_drivers/Keysight/KeysightAgilent_33XXX.py @@ -13,7 +13,7 @@ from .private.error_handling import KeysightErrorQueueMixin if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_34410A_submodules.py b/src/qcodes/instrument_drivers/Keysight/Keysight_34410A_submodules.py index ca36290f5f21..00797004db48 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_34410A_submodules.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_34410A_submodules.py @@ -3,7 +3,7 @@ from .private.Keysight_344xxA_submodules import Keysight344xxA if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_34411A_submodules.py b/src/qcodes/instrument_drivers/Keysight/Keysight_34411A_submodules.py index 3d007ab4f45a..87851f2858d1 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_34411A_submodules.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_34411A_submodules.py @@ -3,7 +3,7 @@ from .private.Keysight_344xxA_submodules import Keysight344xxA if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_34460A_submodules.py b/src/qcodes/instrument_drivers/Keysight/Keysight_34460A_submodules.py index 139228680e9e..0490a0ec4d45 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_34460A_submodules.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_34460A_submodules.py @@ -3,7 +3,7 @@ from .private.Keysight_344xxA_submodules import Keysight344xxA if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_34461A_submodules.py b/src/qcodes/instrument_drivers/Keysight/Keysight_34461A_submodules.py index 7b1ec5a21cd3..f8961fef9aec 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_34461A_submodules.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_34461A_submodules.py @@ -3,7 +3,7 @@ from .private.Keysight_344xxA_submodules import Keysight344xxA if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_34465A_submodules.py b/src/qcodes/instrument_drivers/Keysight/Keysight_34465A_submodules.py index 61b6f167ff37..94d011b5b196 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_34465A_submodules.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_34465A_submodules.py @@ -3,7 +3,7 @@ from .private.Keysight_344xxA_submodules import Keysight344xxA if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_34470A_submodules.py b/src/qcodes/instrument_drivers/Keysight/Keysight_34470A_submodules.py index b0cab72551d2..9ed5374f718a 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_34470A_submodules.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_34470A_submodules.py @@ -3,7 +3,7 @@ from .private.Keysight_344xxA_submodules import Keysight344xxA if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_B2962A.py b/src/qcodes/instrument_drivers/Keysight/Keysight_B2962A.py index 5bbdf7d55e74..d98016e164ac 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_B2962A.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_B2962A.py @@ -13,7 +13,7 @@ from qcodes.utils.deprecate import QCoDeSDeprecationWarning if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_N5183B.py b/src/qcodes/instrument_drivers/Keysight/Keysight_N5183B.py index af9af57fbf6b..71dc8ff95522 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_N5183B.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_N5183B.py @@ -6,7 +6,7 @@ from qcodes.utils.deprecate import QCoDeSDeprecationWarning if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_N5222B.py b/src/qcodes/instrument_drivers/Keysight/Keysight_N5222B.py index 8ca2bcaf1fb0..7fcd0963243e 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_N5222B.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_N5222B.py @@ -3,7 +3,7 @@ from . import N52xx if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_N5230C.py b/src/qcodes/instrument_drivers/Keysight/Keysight_N5230C.py index 15b70d1de7c7..dbc151ba141d 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_N5230C.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_N5230C.py @@ -3,7 +3,7 @@ from . import N52xx if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_N5245A.py b/src/qcodes/instrument_drivers/Keysight/Keysight_N5245A.py index 798882abf289..809128837d2e 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_N5245A.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_N5245A.py @@ -3,7 +3,7 @@ from . import N52xx if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_N6705B.py b/src/qcodes/instrument_drivers/Keysight/Keysight_N6705B.py index 6121239bbff8..8007122912ba 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_N6705B.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_N6705B.py @@ -12,7 +12,7 @@ from qcodes.utils.deprecate import QCoDeSDeprecationWarning if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_N9030B.py b/src/qcodes/instrument_drivers/Keysight/Keysight_N9030B.py index 4680cf1c17cc..d324ecf2519a 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_N9030B.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_N9030B.py @@ -23,8 +23,7 @@ if TYPE_CHECKING: from collections.abc import Callable - - from typing_extensions import Unpack + from typing import Unpack _T = TypeVar( "_T", @@ -63,7 +62,8 @@ def get_raw(self) -> npt.NDArray[np.float64]: class Trace( - ParameterWithSetpoints[ParameterDataTypeVar, _T], Generic[ParameterDataTypeVar, _T] + ParameterWithSetpoints[ParameterDataTypeVar, _T], + Generic[ParameterDataTypeVar, _T], # noqa: UP046 -- Generic kept because multi-inheritance with type params is not yet supported ): def __init__( self, diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_P5002B.py b/src/qcodes/instrument_drivers/Keysight/Keysight_P5002B.py index c8776c66b42c..d2b9c1f6771a 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_P5002B.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_P5002B.py @@ -3,7 +3,7 @@ from . import N52xx if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_P5004B.py b/src/qcodes/instrument_drivers/Keysight/Keysight_P5004B.py index 98c782ab4e9e..90596381fc96 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_P5004B.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_P5004B.py @@ -3,7 +3,7 @@ from . import N52xx if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Keysight/Keysight_P9374A.py b/src/qcodes/instrument_drivers/Keysight/Keysight_P9374A.py index 760d872abfc8..553f0c0a9ddb 100644 --- a/src/qcodes/instrument_drivers/Keysight/Keysight_P9374A.py +++ b/src/qcodes/instrument_drivers/Keysight/Keysight_P9374A.py @@ -3,7 +3,7 @@ from . import N52xx if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Keysight/KtM960x.py b/src/qcodes/instrument_drivers/Keysight/KtM960x.py index 326b22fe3d5a..01a78946dfa1 100644 --- a/src/qcodes/instrument_drivers/Keysight/KtM960x.py +++ b/src/qcodes/instrument_drivers/Keysight/KtM960x.py @@ -18,11 +18,12 @@ from . import KtM960xDefs if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack class Measure( - MultiParameter[ParameterDataTypeVar, "KeysightM960x"], Generic[ParameterDataTypeVar] + MultiParameter[ParameterDataTypeVar, "KeysightM960x"], + Generic[ParameterDataTypeVar], # noqa: UP046 -- Generic kept because multi-inheritance with type params is not yet supported ): def __init__(self, name: str, instrument: "KeysightM960x") -> None: super().__init__( diff --git a/src/qcodes/instrument_drivers/Keysight/KtMAwg.py b/src/qcodes/instrument_drivers/Keysight/KtMAwg.py index 54054e88a8a4..ac70fc99db81 100644 --- a/src/qcodes/instrument_drivers/Keysight/KtMAwg.py +++ b/src/qcodes/instrument_drivers/Keysight/KtMAwg.py @@ -12,7 +12,7 @@ from . import KtMAwgDefs if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack _ch_type = bytes | ctypes.Array[ctypes.c_char] diff --git a/src/qcodes/instrument_drivers/Keysight/N51x1.py b/src/qcodes/instrument_drivers/Keysight/N51x1.py index 1e5e270c4741..40889c3902db 100644 --- a/src/qcodes/instrument_drivers/Keysight/N51x1.py +++ b/src/qcodes/instrument_drivers/Keysight/N51x1.py @@ -5,7 +5,7 @@ from qcodes.validators import Numbers if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack class KeysightN51x1(VisaInstrument): diff --git a/src/qcodes/instrument_drivers/Keysight/N52xx.py b/src/qcodes/instrument_drivers/Keysight/N52xx.py index d7c3e4cfddab..7165570c3580 100644 --- a/src/qcodes/instrument_drivers/Keysight/N52xx.py +++ b/src/qcodes/instrument_drivers/Keysight/N52xx.py @@ -24,8 +24,7 @@ if TYPE_CHECKING: from collections.abc import Sequence - - from typing_extensions import Unpack + from typing import Unpack class PNAAxisParameter(Parameter): diff --git a/src/qcodes/instrument_drivers/Keysight/_Keysight_N5232B.py b/src/qcodes/instrument_drivers/Keysight/_Keysight_N5232B.py index 6fc3389424d9..e153db517e6f 100644 --- a/src/qcodes/instrument_drivers/Keysight/_Keysight_N5232B.py +++ b/src/qcodes/instrument_drivers/Keysight/_Keysight_N5232B.py @@ -3,7 +3,7 @@ from . import N52xx if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Keysight/keysight_34934a.py b/src/qcodes/instrument_drivers/Keysight/keysight_34934a.py index 2ac7a6e7dec9..c1bd9a1c1233 100644 --- a/src/qcodes/instrument_drivers/Keysight/keysight_34934a.py +++ b/src/qcodes/instrument_drivers/Keysight/keysight_34934a.py @@ -8,8 +8,7 @@ if TYPE_CHECKING: from collections.abc import Callable - - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import ( InstrumentBaseKWArgs, diff --git a/src/qcodes/instrument_drivers/Keysight/keysight_34980a.py b/src/qcodes/instrument_drivers/Keysight/keysight_34980a.py index a5ffe4713c06..c68dc9b796bf 100644 --- a/src/qcodes/instrument_drivers/Keysight/keysight_34980a.py +++ b/src/qcodes/instrument_drivers/Keysight/keysight_34980a.py @@ -14,9 +14,7 @@ if TYPE_CHECKING: from collections.abc import Callable - from typing import Concatenate - - from typing_extensions import Unpack + from typing import Concatenate, Unpack KEYSIGHT_MODELS = {"34934A": Keysight34934A} diff --git a/src/qcodes/instrument_drivers/Keysight/keysight_34980a_submodules.py b/src/qcodes/instrument_drivers/Keysight/keysight_34980a_submodules.py index 094154a53193..67c44060a613 100644 --- a/src/qcodes/instrument_drivers/Keysight/keysight_34980a_submodules.py +++ b/src/qcodes/instrument_drivers/Keysight/keysight_34980a_submodules.py @@ -3,7 +3,7 @@ from qcodes.instrument import InstrumentBaseKWArgs, InstrumentChannel if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from .keysight_34980a import Keysight34980A diff --git a/src/qcodes/instrument_drivers/Keysight/keysight_b220x.py b/src/qcodes/instrument_drivers/Keysight/keysight_b220x.py index 423ff729a300..c6c8898552a0 100644 --- a/src/qcodes/instrument_drivers/Keysight/keysight_b220x.py +++ b/src/qcodes/instrument_drivers/Keysight/keysight_b220x.py @@ -10,9 +10,7 @@ if TYPE_CHECKING: from collections.abc import Callable, Sequence - from typing import Concatenate - - from typing_extensions import Unpack + from typing import Concatenate, Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/Keysight/keysight_e4980a.py b/src/qcodes/instrument_drivers/Keysight/keysight_e4980a.py index 76fe3c0383b4..a301c3cafdf5 100644 --- a/src/qcodes/instrument_drivers/Keysight/keysight_e4980a.py +++ b/src/qcodes/instrument_drivers/Keysight/keysight_e4980a.py @@ -25,8 +25,7 @@ if TYPE_CHECKING: from collections.abc import Sequence - - from typing_extensions import Unpack + from typing import Unpack class KeysightE4980AMeasurementPair(MultiParameter): diff --git a/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py b/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py index a14786bcf7fb..681b85c80372 100644 --- a/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py +++ b/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py @@ -25,8 +25,7 @@ if TYPE_CHECKING: from collections.abc import Sequence - - from typing_extensions import Unpack + from typing import Unpack class MeasurementModeDict(TypedDict): @@ -500,7 +499,7 @@ def enable_smu_filters( class IVSweepMeasurement( MultiParameter[ParameterDataTypeVar, KeysightB1500], StatusMixin, - Generic[ParameterDataTypeVar], + Generic[ParameterDataTypeVar], # noqa: UP046 -- Generic kept because multi-inheritance with type params is not yet supported ): """ IV sweep measurement outputs a list of measured current parameters diff --git a/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py b/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py index 9a219dc378c6..ab21bd1ed943 100644 --- a/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py +++ b/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py @@ -1,9 +1,9 @@ import re -from typing import TYPE_CHECKING, Any, NamedTuple, cast +from typing import TYPE_CHECKING, Any, NamedTuple, Unpack, cast import numpy as np import numpy.typing as npt -from typing_extensions import TypedDict, Unpack +from typing_extensions import TypedDict from qcodes.instrument import InstrumentBaseKWArgs, InstrumentChannel diff --git a/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1517A.py b/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1517A.py index 774d7380ab94..f5c495ca1ff7 100644 --- a/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1517A.py +++ b/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1517A.py @@ -1,10 +1,10 @@ import re import textwrap -from typing import TYPE_CHECKING, Any, Generic, Literal, NotRequired, overload +from typing import TYPE_CHECKING, Any, Generic, Literal, NotRequired, Unpack, overload import numpy as np import numpy.typing as npt -from typing_extensions import TypedDict, Unpack, deprecated +from typing_extensions import TypedDict, deprecated import qcodes.validators as vals from qcodes.instrument import InstrumentBaseKWArgs, InstrumentChannel @@ -711,7 +711,8 @@ class IVSweeper(KeysightB1500IVSweeper): class _ParameterWithStatus( - Parameter[ParameterDataTypeVar, "KeysightB1517A"], Generic[ParameterDataTypeVar] + Parameter[ParameterDataTypeVar, "KeysightB1517A"], + Generic[ParameterDataTypeVar], # noqa: UP046 -- Generic kept because multi-inheritance with type params is not yet supported ): def __init__(self, *args: Any, **kwargs: Any): super().__init__(*args, **kwargs) @@ -738,7 +739,8 @@ def snapshot_base( class _SpotMeasurementVoltageParameter( - _ParameterWithStatus[ParameterDataTypeVar], Generic[ParameterDataTypeVar] + _ParameterWithStatus[ParameterDataTypeVar], + Generic[ParameterDataTypeVar], # noqa: UP046 -- Generic kept because multi-inheritance with type params is not yet supported ): def set_raw(self, value: ParamRawDataType) -> None: smu = self.instrument @@ -781,7 +783,8 @@ def get_raw(self) -> ParamRawDataType: class _SpotMeasurementCurrentParameter( - _ParameterWithStatus[ParameterDataTypeVar], Generic[ParameterDataTypeVar] + _ParameterWithStatus[ParameterDataTypeVar], + Generic[ParameterDataTypeVar], # noqa: UP046 -- Generic kept because multi-inheritance with type params is not yet supported ): def set_raw(self, value: ParamRawDataType) -> None: smu = self.instrument diff --git a/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py b/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py index 686766e40e3c..c8dee17bcf2a 100644 --- a/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py +++ b/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py @@ -28,7 +28,7 @@ from .message_builder import MessageBuilder if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_base import ( KeysightB1500, diff --git a/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1530A.py b/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1530A.py index 72b648eeb1e7..b17765efae0d 100644 --- a/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1530A.py +++ b/src/qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1530A.py @@ -8,7 +8,7 @@ from .KeysightB1500_module import KeysightB1500Module if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import InstrumentBaseKWArgs from qcodes.instrument_drivers.Keysight.keysightb1500.KeysightB1500_base import ( diff --git a/src/qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py b/src/qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py index 5bf2cd0d07d5..03bfa1a51b1b 100644 --- a/src/qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py +++ b/src/qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py @@ -1,6 +1,6 @@ from functools import wraps from operator import xor -from typing import TYPE_CHECKING, Generic, ParamSpec, TypeVar +from typing import TYPE_CHECKING, ParamSpec, TypeVar from . import constants @@ -28,7 +28,7 @@ def wrapper(*args: P.args, **kwargs: P.kwargs) -> "MessageBuilder": return wrapper -class CommandList(list[T], Generic[T]): +class CommandList[T](list[T]): def __init__(self) -> None: super().__init__() self.is_final = False diff --git a/src/qcodes/instrument_drivers/Keysight/private/Keysight_344xxA_submodules.py b/src/qcodes/instrument_drivers/Keysight/private/Keysight_344xxA_submodules.py index 4166adca35f8..c14ab2874dcc 100644 --- a/src/qcodes/instrument_drivers/Keysight/private/Keysight_344xxA_submodules.py +++ b/src/qcodes/instrument_drivers/Keysight/private/Keysight_344xxA_submodules.py @@ -25,8 +25,7 @@ if TYPE_CHECKING: from collections.abc import Callable, Sequence - - from typing_extensions import Unpack + from typing import Unpack class Keysight344xxATrigger(InstrumentChannel["Keysight344xxA"]): diff --git a/src/qcodes/instrument_drivers/Lakeshore/Lakeshore_model_325.py b/src/qcodes/instrument_drivers/Lakeshore/Lakeshore_model_325.py index 6626a93ff903..4cbaf3847a93 100644 --- a/src/qcodes/instrument_drivers/Lakeshore/Lakeshore_model_325.py +++ b/src/qcodes/instrument_drivers/Lakeshore/Lakeshore_model_325.py @@ -18,8 +18,7 @@ if TYPE_CHECKING: from collections.abc import Iterable - - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument.channel import ChannelTuple diff --git a/src/qcodes/instrument_drivers/Lakeshore/Lakeshore_model_336.py b/src/qcodes/instrument_drivers/Lakeshore/Lakeshore_model_336.py index 509c087608e9..3af71f9ab98f 100644 --- a/src/qcodes/instrument_drivers/Lakeshore/Lakeshore_model_336.py +++ b/src/qcodes/instrument_drivers/Lakeshore/Lakeshore_model_336.py @@ -10,7 +10,7 @@ ) if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import InstrumentBaseKWArgs, VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Lakeshore/Lakeshore_model_372.py b/src/qcodes/instrument_drivers/Lakeshore/Lakeshore_model_372.py index 46bcec7212e2..22ac6f1713de 100644 --- a/src/qcodes/instrument_drivers/Lakeshore/Lakeshore_model_372.py +++ b/src/qcodes/instrument_drivers/Lakeshore/Lakeshore_model_372.py @@ -9,7 +9,7 @@ from qcodes.parameters import Group, GroupParameter if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import InstrumentBaseKWArgs, VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Lakeshore/_lakeshore_model_335.py b/src/qcodes/instrument_drivers/Lakeshore/_lakeshore_model_335.py index 44571961744e..afa82d4ababc 100644 --- a/src/qcodes/instrument_drivers/Lakeshore/_lakeshore_model_335.py +++ b/src/qcodes/instrument_drivers/Lakeshore/_lakeshore_model_335.py @@ -13,7 +13,7 @@ ) if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import InstrumentBaseKWArgs, VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/Lakeshore/lakeshore_base.py b/src/qcodes/instrument_drivers/Lakeshore/lakeshore_base.py index 433090d13897..bc518b3edb6d 100644 --- a/src/qcodes/instrument_drivers/Lakeshore/lakeshore_base.py +++ b/src/qcodes/instrument_drivers/Lakeshore/lakeshore_base.py @@ -17,8 +17,7 @@ if TYPE_CHECKING: from collections.abc import Sequence - - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument.channel import ChannelTuple diff --git a/src/qcodes/instrument_drivers/Minicircuits/Base_SPDT.py b/src/qcodes/instrument_drivers/Minicircuits/Base_SPDT.py index 193b6bac010d..f391d7ea632c 100644 --- a/src/qcodes/instrument_drivers/Minicircuits/Base_SPDT.py +++ b/src/qcodes/instrument_drivers/Minicircuits/Base_SPDT.py @@ -13,7 +13,7 @@ from qcodes.validators import Ints if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter @@ -22,7 +22,7 @@ _TINSTR = TypeVar("_TINSTR", bound="MiniCircuitsSPDTBase") -class MiniCircuitsSPDTSwitchChannelBase(InstrumentChannel[_TINSTR], Generic[_TINSTR]): +class MiniCircuitsSPDTSwitchChannelBase(InstrumentChannel[_TINSTR], Generic[_TINSTR]): # noqa: UP046 -- Generic kept because multi-inheritance with type params is not yet supported def __init__( self, parent: _TINSTR, diff --git a/src/qcodes/instrument_drivers/Minicircuits/USBHIDMixin.py b/src/qcodes/instrument_drivers/Minicircuits/USBHIDMixin.py index 5c0c66975284..16d91e0604f3 100644 --- a/src/qcodes/instrument_drivers/Minicircuits/USBHIDMixin.py +++ b/src/qcodes/instrument_drivers/Minicircuits/USBHIDMixin.py @@ -21,7 +21,7 @@ from qcodes.instrument import Instrument if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import InstrumentBaseKWArgs diff --git a/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_rc_sp4t.py b/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_rc_sp4t.py index 87dfcd664c7b..f64237503f1e 100644 --- a/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_rc_sp4t.py +++ b/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_rc_sp4t.py @@ -10,7 +10,7 @@ ) if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_rc_spdt.py b/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_rc_spdt.py index 6a76e0a7e3d7..04b28cbe0bd3 100644 --- a/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_rc_spdt.py +++ b/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_rc_spdt.py @@ -9,7 +9,7 @@ ) if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument.channel import ChannelTuple from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_rudat_13g_90.py b/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_rudat_13g_90.py index 192c337e742c..d9e63796880c 100644 --- a/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_rudat_13g_90.py +++ b/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_rudat_13g_90.py @@ -5,7 +5,7 @@ from .USBHIDMixin import MiniCircuitsHIDMixin if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_usb_spdt.py b/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_usb_spdt.py index 206a9531c7a4..52bca795699a 100644 --- a/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_usb_spdt.py +++ b/src/qcodes/instrument_drivers/Minicircuits/_minicircuits_usb_spdt.py @@ -8,7 +8,7 @@ ) if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import InstrumentBaseKWArgs diff --git a/src/qcodes/instrument_drivers/QDev/QDac_channels.py b/src/qcodes/instrument_drivers/QDev/QDac_channels.py index d7ec6e79e141..4016ab1e019c 100644 --- a/src/qcodes/instrument_drivers/QDev/QDac_channels.py +++ b/src/qcodes/instrument_drivers/QDev/QDac_channels.py @@ -21,8 +21,7 @@ if TYPE_CHECKING: from collections.abc import Sequence - - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/QuantumDesign/DynaCoolPPMS/DynaCool.py b/src/qcodes/instrument_drivers/QuantumDesign/DynaCoolPPMS/DynaCool.py index 080ba979864d..4edafe7155cf 100644 --- a/src/qcodes/instrument_drivers/QuantumDesign/DynaCoolPPMS/DynaCool.py +++ b/src/qcodes/instrument_drivers/QuantumDesign/DynaCoolPPMS/DynaCool.py @@ -11,8 +11,7 @@ if TYPE_CHECKING: from collections.abc import Callable - - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/agilent/Agilent_34401A.py b/src/qcodes/instrument_drivers/agilent/Agilent_34401A.py index 816bf922f52f..470fb6da5a28 100644 --- a/src/qcodes/instrument_drivers/agilent/Agilent_34401A.py +++ b/src/qcodes/instrument_drivers/agilent/Agilent_34401A.py @@ -6,7 +6,7 @@ from ._Agilent_344xxA import Agilent344xxA if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/agilent/Agilent_34410A.py b/src/qcodes/instrument_drivers/agilent/Agilent_34410A.py index b09278f0ca94..ebb7d8cc2a37 100644 --- a/src/qcodes/instrument_drivers/agilent/Agilent_34410A.py +++ b/src/qcodes/instrument_drivers/agilent/Agilent_34410A.py @@ -6,7 +6,7 @@ from ._Agilent_344xxA import Agilent344xxA if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/agilent/Agilent_34411A.py b/src/qcodes/instrument_drivers/agilent/Agilent_34411A.py index 8167de1c2acc..7f40403dfbf1 100644 --- a/src/qcodes/instrument_drivers/agilent/Agilent_34411A.py +++ b/src/qcodes/instrument_drivers/agilent/Agilent_34411A.py @@ -6,7 +6,7 @@ from ._Agilent_344xxA import Agilent344xxA if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/agilent/Agilent_E8257D.py b/src/qcodes/instrument_drivers/agilent/Agilent_E8257D.py index 433b0c31c3a8..69b5b710ab3e 100644 --- a/src/qcodes/instrument_drivers/agilent/Agilent_E8257D.py +++ b/src/qcodes/instrument_drivers/agilent/Agilent_E8257D.py @@ -8,7 +8,7 @@ from qcodes.parameters import Parameter, create_on_off_val_mapping if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack class AgilentE8257D(VisaInstrument): diff --git a/src/qcodes/instrument_drivers/agilent/Agilent_E8267C.py b/src/qcodes/instrument_drivers/agilent/Agilent_E8267C.py index 6de81905392f..38fbeb4ed117 100644 --- a/src/qcodes/instrument_drivers/agilent/Agilent_E8267C.py +++ b/src/qcodes/instrument_drivers/agilent/Agilent_E8267C.py @@ -6,7 +6,7 @@ from qcodes.validators import Enum, Numbers if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/agilent/_Agilent_344xxA.py b/src/qcodes/instrument_drivers/agilent/_Agilent_344xxA.py index d6bdf493e2e0..609cdbf0f91c 100644 --- a/src/qcodes/instrument_drivers/agilent/_Agilent_344xxA.py +++ b/src/qcodes/instrument_drivers/agilent/_Agilent_344xxA.py @@ -5,7 +5,7 @@ from qcodes.validators import Enum if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack class Agilent344xxA(VisaInstrument): diff --git a/src/qcodes/instrument_drivers/american_magnetics/AMI430_visa.py b/src/qcodes/instrument_drivers/american_magnetics/AMI430_visa.py index 3d701d54b129..21a0c8a4a373 100644 --- a/src/qcodes/instrument_drivers/american_magnetics/AMI430_visa.py +++ b/src/qcodes/instrument_drivers/american_magnetics/AMI430_visa.py @@ -25,7 +25,7 @@ from qcodes.validators import Anything, Bool, Enum, Ints, Numbers if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack log = logging.getLogger(__name__) diff --git a/src/qcodes/instrument_drivers/basel/BaselSP983.py b/src/qcodes/instrument_drivers/basel/BaselSP983.py index 19ce488a0554..7a81b8f267e3 100644 --- a/src/qcodes/instrument_drivers/basel/BaselSP983.py +++ b/src/qcodes/instrument_drivers/basel/BaselSP983.py @@ -5,7 +5,7 @@ from qcodes.validators import Enum, Numbers if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack class BaselSP983(Instrument): diff --git a/src/qcodes/instrument_drivers/basel/BaselSP983a.py b/src/qcodes/instrument_drivers/basel/BaselSP983a.py index f897dc595605..93e076798df0 100644 --- a/src/qcodes/instrument_drivers/basel/BaselSP983a.py +++ b/src/qcodes/instrument_drivers/basel/BaselSP983a.py @@ -7,7 +7,7 @@ from qcodes.parameters import DelegateParameter, Parameter if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack class BaselSP983a(VisaInstrument): diff --git a/src/qcodes/instrument_drivers/cryomagnetics/_TM620.py b/src/qcodes/instrument_drivers/cryomagnetics/_TM620.py index 382e3487afa3..1dee444cbc21 100644 --- a/src/qcodes/instrument_drivers/cryomagnetics/_TM620.py +++ b/src/qcodes/instrument_drivers/cryomagnetics/_TM620.py @@ -5,7 +5,7 @@ from qcodes.instrument import VisaInstrument, VisaInstrumentKWArgs if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/cryomagnetics/_cryomagnetics4g.py b/src/qcodes/instrument_drivers/cryomagnetics/_cryomagnetics4g.py index ef31232682ef..1d9ddb2effc3 100644 --- a/src/qcodes/instrument_drivers/cryomagnetics/_cryomagnetics4g.py +++ b/src/qcodes/instrument_drivers/cryomagnetics/_cryomagnetics4g.py @@ -11,7 +11,7 @@ from qcodes.validators import Enum, Numbers if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/ithaco/Ithaco_1211.py b/src/qcodes/instrument_drivers/ithaco/Ithaco_1211.py index 911690528233..da12b7b28925 100644 --- a/src/qcodes/instrument_drivers/ithaco/Ithaco_1211.py +++ b/src/qcodes/instrument_drivers/ithaco/Ithaco_1211.py @@ -8,7 +8,7 @@ from qcodes.validators import Bool, Enum if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack class CurrentParameter( diff --git a/src/qcodes/instrument_drivers/mock_instruments/__init__.py b/src/qcodes/instrument_drivers/mock_instruments/__init__.py index 551d9a67546e..4f01e875286a 100644 --- a/src/qcodes/instrument_drivers/mock_instruments/__init__.py +++ b/src/qcodes/instrument_drivers/mock_instruments/__init__.py @@ -27,8 +27,7 @@ if TYPE_CHECKING: from collections.abc import Generator, Sequence - - from typing_extensions import Unpack + from typing import Unpack log = logging.getLogger(__name__) diff --git a/src/qcodes/instrument_drivers/oxford/MercuryiPS_VISA.py b/src/qcodes/instrument_drivers/oxford/MercuryiPS_VISA.py index 0f48e5b62e69..c70d74d4fdc4 100644 --- a/src/qcodes/instrument_drivers/oxford/MercuryiPS_VISA.py +++ b/src/qcodes/instrument_drivers/oxford/MercuryiPS_VISA.py @@ -21,8 +21,7 @@ if TYPE_CHECKING: from collections.abc import Callable - - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/oxford/triton.py b/src/qcodes/instrument_drivers/oxford/triton.py index 0d240239d98c..4496142d465a 100644 --- a/src/qcodes/instrument_drivers/oxford/triton.py +++ b/src/qcodes/instrument_drivers/oxford/triton.py @@ -12,7 +12,7 @@ from qcodes.validators import Enum, Ints, Numbers if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/rigol/Rigol_DG1062.py b/src/qcodes/instrument_drivers/rigol/Rigol_DG1062.py index ac6f6d7297b9..625381d8089e 100644 --- a/src/qcodes/instrument_drivers/rigol/Rigol_DG1062.py +++ b/src/qcodes/instrument_drivers/rigol/Rigol_DG1062.py @@ -13,7 +13,7 @@ from qcodes.utils import partial_with_docstring if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/rigol/Rigol_DG4000.py b/src/qcodes/instrument_drivers/rigol/Rigol_DG4000.py index 873cfc7289d8..dfafbc0c1519 100644 --- a/src/qcodes/instrument_drivers/rigol/Rigol_DG4000.py +++ b/src/qcodes/instrument_drivers/rigol/Rigol_DG4000.py @@ -6,9 +6,9 @@ if TYPE_CHECKING: from collections.abc import Sequence + from typing import Unpack import numpy.typing as npt - from typing_extensions import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/rigol/Rigol_DP821.py b/src/qcodes/instrument_drivers/rigol/Rigol_DP821.py index 83b0eff9cb67..6bb89ad43f2c 100644 --- a/src/qcodes/instrument_drivers/rigol/Rigol_DP821.py +++ b/src/qcodes/instrument_drivers/rigol/Rigol_DP821.py @@ -3,7 +3,7 @@ from .private.DP8xx import RigolDP8xxBase if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/rigol/Rigol_DP831.py b/src/qcodes/instrument_drivers/rigol/Rigol_DP831.py index 75b3028be817..681c3148f5f0 100644 --- a/src/qcodes/instrument_drivers/rigol/Rigol_DP831.py +++ b/src/qcodes/instrument_drivers/rigol/Rigol_DP831.py @@ -3,7 +3,7 @@ from .private.DP8xx import RigolDP8xxBase if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/rigol/Rigol_DP832.py b/src/qcodes/instrument_drivers/rigol/Rigol_DP832.py index a905edc141c4..029fd0c51485 100644 --- a/src/qcodes/instrument_drivers/rigol/Rigol_DP832.py +++ b/src/qcodes/instrument_drivers/rigol/Rigol_DP832.py @@ -3,7 +3,7 @@ from .private.DP8xx import RigolDP8xxBase if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/rigol/Rigol_DS1074Z.py b/src/qcodes/instrument_drivers/rigol/Rigol_DS1074Z.py index b3e196205544..75cad0548fa2 100644 --- a/src/qcodes/instrument_drivers/rigol/Rigol_DS1074Z.py +++ b/src/qcodes/instrument_drivers/rigol/Rigol_DS1074Z.py @@ -14,7 +14,7 @@ from qcodes.validators import Arrays, Enum, Numbers if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/rigol/Rigol_DS4000.py b/src/qcodes/instrument_drivers/rigol/Rigol_DS4000.py index ac2a44180c67..7ad09bec987a 100644 --- a/src/qcodes/instrument_drivers/rigol/Rigol_DS4000.py +++ b/src/qcodes/instrument_drivers/rigol/Rigol_DS4000.py @@ -20,7 +20,7 @@ from qcodes.parameters import ArrayParameter, ParamRawDataType if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/rigol/private/DP8xx.py b/src/qcodes/instrument_drivers/rigol/private/DP8xx.py index c6e566b68a8e..493c752cd01d 100644 --- a/src/qcodes/instrument_drivers/rigol/private/DP8xx.py +++ b/src/qcodes/instrument_drivers/rigol/private/DP8xx.py @@ -11,8 +11,7 @@ if TYPE_CHECKING: from collections.abc import Sequence - - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/rohde_schwarz/RTO1000.py b/src/qcodes/instrument_drivers/rohde_schwarz/RTO1000.py index 94ad53118d20..f0cbbe9251d7 100644 --- a/src/qcodes/instrument_drivers/rohde_schwarz/RTO1000.py +++ b/src/qcodes/instrument_drivers/rohde_schwarz/RTO1000.py @@ -22,7 +22,7 @@ from qcodes.parameters import ArrayParameter, Parameter, create_on_off_val_mapping if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack log = logging.getLogger(__name__) diff --git a/src/qcodes/instrument_drivers/rohde_schwarz/SGS100A.py b/src/qcodes/instrument_drivers/rohde_schwarz/SGS100A.py index 2db86630fd25..627e19a2e2b3 100644 --- a/src/qcodes/instrument_drivers/rohde_schwarz/SGS100A.py +++ b/src/qcodes/instrument_drivers/rohde_schwarz/SGS100A.py @@ -8,7 +8,7 @@ from qcodes.utils.deprecate import QCoDeSDeprecationWarning if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/rohde_schwarz/ZNB.py b/src/qcodes/instrument_drivers/rohde_schwarz/ZNB.py index f8fad7c1f034..02497f5e767d 100644 --- a/src/qcodes/instrument_drivers/rohde_schwarz/ZNB.py +++ b/src/qcodes/instrument_drivers/rohde_schwarz/ZNB.py @@ -22,7 +22,7 @@ ) if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack log = logging.getLogger(__name__) diff --git a/src/qcodes/instrument_drivers/signal_hound/SignalHound_USB_SA124B.py b/src/qcodes/instrument_drivers/signal_hound/SignalHound_USB_SA124B.py index 4f8c728b9048..7cdf506eeb61 100644 --- a/src/qcodes/instrument_drivers/signal_hound/SignalHound_USB_SA124B.py +++ b/src/qcodes/instrument_drivers/signal_hound/SignalHound_USB_SA124B.py @@ -12,7 +12,7 @@ from qcodes.parameters import ArrayParameter, Parameter, ParameterWithSetpoints if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack log = logging.getLogger(__name__) diff --git a/src/qcodes/instrument_drivers/stahl/stahl.py b/src/qcodes/instrument_drivers/stahl/stahl.py index afa3637fe841..93a8afb65368 100644 --- a/src/qcodes/instrument_drivers/stahl/stahl.py +++ b/src/qcodes/instrument_drivers/stahl/stahl.py @@ -23,7 +23,7 @@ from qcodes.validators import Numbers if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/stanford_research/SG384.py b/src/qcodes/instrument_drivers/stanford_research/SG384.py index 7c1b58f2d6b4..690c5a80280e 100644 --- a/src/qcodes/instrument_drivers/stanford_research/SG384.py +++ b/src/qcodes/instrument_drivers/stanford_research/SG384.py @@ -7,7 +7,7 @@ from qcodes.utils.deprecate import QCoDeSDeprecationWarning if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/stanford_research/SR560.py b/src/qcodes/instrument_drivers/stanford_research/SR560.py index 7da60afcfca5..78c7b6d09f26 100644 --- a/src/qcodes/instrument_drivers/stanford_research/SR560.py +++ b/src/qcodes/instrument_drivers/stanford_research/SR560.py @@ -5,7 +5,7 @@ from qcodes.validators import Bool, Enum if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack class VoltageParameter(MultiParameter): diff --git a/src/qcodes/instrument_drivers/stanford_research/SR830.py b/src/qcodes/instrument_drivers/stanford_research/SR830.py index 6ce5413f602f..d5febc480ef3 100644 --- a/src/qcodes/instrument_drivers/stanford_research/SR830.py +++ b/src/qcodes/instrument_drivers/stanford_research/SR830.py @@ -17,8 +17,7 @@ if TYPE_CHECKING: from collections.abc import Iterable - - from typing_extensions import Unpack + from typing import Unpack class ChannelTrace(ParameterWithSetpoints): diff --git a/src/qcodes/instrument_drivers/stanford_research/SR860.py b/src/qcodes/instrument_drivers/stanford_research/SR860.py index 7cbc82171f8f..c20f52025d31 100644 --- a/src/qcodes/instrument_drivers/stanford_research/SR860.py +++ b/src/qcodes/instrument_drivers/stanford_research/SR860.py @@ -3,7 +3,7 @@ from qcodes.instrument_drivers.stanford_research.SR86x import SR86x if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/stanford_research/SR865.py b/src/qcodes/instrument_drivers/stanford_research/SR865.py index 1fe7a5a4422c..cdf779883091 100644 --- a/src/qcodes/instrument_drivers/stanford_research/SR865.py +++ b/src/qcodes/instrument_drivers/stanford_research/SR865.py @@ -3,7 +3,7 @@ from qcodes.instrument_drivers.stanford_research.SR86x import SR86x if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/stanford_research/SR865A.py b/src/qcodes/instrument_drivers/stanford_research/SR865A.py index f4d1019857ea..961070531710 100644 --- a/src/qcodes/instrument_drivers/stanford_research/SR865A.py +++ b/src/qcodes/instrument_drivers/stanford_research/SR865A.py @@ -3,7 +3,7 @@ from qcodes.instrument_drivers.stanford_research.SR86x import SR86x if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/stanford_research/SR86x.py b/src/qcodes/instrument_drivers/stanford_research/SR86x.py index a206d0f5da9c..a7bdc84d3aad 100644 --- a/src/qcodes/instrument_drivers/stanford_research/SR86x.py +++ b/src/qcodes/instrument_drivers/stanford_research/SR86x.py @@ -19,8 +19,7 @@ if TYPE_CHECKING: from collections.abc import Callable, Sequence - - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/tektronix/AWG5014.py b/src/qcodes/instrument_drivers/tektronix/AWG5014.py index 23cb84ed93dd..6b38b8161e5f 100644 --- a/src/qcodes/instrument_drivers/tektronix/AWG5014.py +++ b/src/qcodes/instrument_drivers/tektronix/AWG5014.py @@ -27,8 +27,7 @@ if TYPE_CHECKING: from collections.abc import Sequence - - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/tektronix/AWG5208.py b/src/qcodes/instrument_drivers/tektronix/AWG5208.py index 0e7dc5c2cf0d..159106c9aad9 100644 --- a/src/qcodes/instrument_drivers/tektronix/AWG5208.py +++ b/src/qcodes/instrument_drivers/tektronix/AWG5208.py @@ -7,7 +7,7 @@ from .AWG70000A import TektronixAWG70000Base if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/tektronix/AWG70000A.py b/src/qcodes/instrument_drivers/tektronix/AWG70000A.py index 0f96df736929..9075090191a3 100644 --- a/src/qcodes/instrument_drivers/tektronix/AWG70000A.py +++ b/src/qcodes/instrument_drivers/tektronix/AWG70000A.py @@ -28,8 +28,7 @@ if TYPE_CHECKING: from collections.abc import Mapping, Sequence - - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/tektronix/AWG70002A.py b/src/qcodes/instrument_drivers/tektronix/AWG70002A.py index 1f1659902120..d443a675423a 100644 --- a/src/qcodes/instrument_drivers/tektronix/AWG70002A.py +++ b/src/qcodes/instrument_drivers/tektronix/AWG70002A.py @@ -7,7 +7,7 @@ from .AWG70000A import TektronixAWG70000Base if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/tektronix/DPO7200xx.py b/src/qcodes/instrument_drivers/tektronix/DPO7200xx.py index 3c546d2c0173..afbd84d1fd5e 100644 --- a/src/qcodes/instrument_drivers/tektronix/DPO7200xx.py +++ b/src/qcodes/instrument_drivers/tektronix/DPO7200xx.py @@ -33,8 +33,7 @@ if TYPE_CHECKING: from collections.abc import Callable - - from typing_extensions import Unpack + from typing import Unpack def strip_quotes(string: str) -> str: @@ -963,7 +962,7 @@ def _trigger_type(self, value: str) -> None: class TektronixDPOMeasurementParameter( Parameter[ParameterDataTypeVar, "TektronixDPOMeasurement"], - Generic[ParameterDataTypeVar], + Generic[ParameterDataTypeVar], # noqa: UP046 -- Generic kept because multi-inheritance with type params is not yet supported ): """ A measurement parameter does not only return the instantaneous value diff --git a/src/qcodes/instrument_drivers/tektronix/TPS2012.py b/src/qcodes/instrument_drivers/tektronix/TPS2012.py index 3b373dc3d1d6..9de61876de19 100644 --- a/src/qcodes/instrument_drivers/tektronix/TPS2012.py +++ b/src/qcodes/instrument_drivers/tektronix/TPS2012.py @@ -1,12 +1,12 @@ import binascii import logging from functools import partial -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Any, Unpack import numpy as np import numpy.typing as npt from pyvisa.errors import VisaIOError -from typing_extensions import TypedDict, Unpack +from typing_extensions import TypedDict from qcodes import validators as vals from qcodes.instrument import ( diff --git a/src/qcodes/instrument_drivers/tektronix/Tektronix_70001A.py b/src/qcodes/instrument_drivers/tektronix/Tektronix_70001A.py index 98171d9119e5..967909786862 100644 --- a/src/qcodes/instrument_drivers/tektronix/Tektronix_70001A.py +++ b/src/qcodes/instrument_drivers/tektronix/Tektronix_70001A.py @@ -3,7 +3,7 @@ from .AWG70000A import TektronixAWG70000Base if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/tektronix/Tektronix_70001B.py b/src/qcodes/instrument_drivers/tektronix/Tektronix_70001B.py index f229f516f6a5..571d68876741 100644 --- a/src/qcodes/instrument_drivers/tektronix/Tektronix_70001B.py +++ b/src/qcodes/instrument_drivers/tektronix/Tektronix_70001B.py @@ -3,7 +3,7 @@ from .AWG70000A import TektronixAWG70000Base if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/tektronix/Tektronix_70002B.py b/src/qcodes/instrument_drivers/tektronix/Tektronix_70002B.py index 3c9483ecc8c6..db13806a12f8 100644 --- a/src/qcodes/instrument_drivers/tektronix/Tektronix_70002B.py +++ b/src/qcodes/instrument_drivers/tektronix/Tektronix_70002B.py @@ -3,7 +3,7 @@ from .AWG70000A import TektronixAWG70000Base if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.instrument import VisaInstrumentKWArgs diff --git a/src/qcodes/instrument_drivers/weinschel/Weinschel_8320.py b/src/qcodes/instrument_drivers/weinschel/Weinschel_8320.py index 47f5b8de7c39..f06b8e1c2c57 100644 --- a/src/qcodes/instrument_drivers/weinschel/Weinschel_8320.py +++ b/src/qcodes/instrument_drivers/weinschel/Weinschel_8320.py @@ -9,7 +9,7 @@ from qcodes.utils.deprecate import QCoDeSDeprecationWarning if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack class Weinschel8320(VisaInstrument): diff --git a/src/qcodes/instrument_drivers/yokogawa/GS200.py b/src/qcodes/instrument_drivers/yokogawa/GS200.py index 908ab1268b9f..1fcc3731d5ca 100644 --- a/src/qcodes/instrument_drivers/yokogawa/GS200.py +++ b/src/qcodes/instrument_drivers/yokogawa/GS200.py @@ -19,7 +19,7 @@ from qcodes.validators import Bool, Enum, Ints, Numbers if TYPE_CHECKING: - from typing_extensions import Unpack + from typing import Unpack from qcodes.parameters import Parameter diff --git a/src/qcodes/instrument_drivers/yokogawa/Yokogawa_GS200.py b/src/qcodes/instrument_drivers/yokogawa/Yokogawa_GS200.py index dd82635aa478..94dbf4c7b556 100644 --- a/src/qcodes/instrument_drivers/yokogawa/Yokogawa_GS200.py +++ b/src/qcodes/instrument_drivers/yokogawa/Yokogawa_GS200.py @@ -11,9 +11,7 @@ from qcodes.validators import Bool, Enum, Ints, Numbers if TYPE_CHECKING: - from typing import assert_never - - from typing_extensions import Unpack + from typing import Unpack, assert_never from qcodes.parameters import Parameter diff --git a/src/qcodes/parameters/array_parameter.py b/src/qcodes/parameters/array_parameter.py index 34cca09fc812..86a26f5f4199 100644 --- a/src/qcodes/parameters/array_parameter.py +++ b/src/qcodes/parameters/array_parameter.py @@ -48,7 +48,7 @@ class ArrayParameter( ParameterBase[ParameterDataTypeVar, InstrumentTypeVar_co], - Generic[ParameterDataTypeVar, InstrumentTypeVar_co], + Generic[ParameterDataTypeVar, InstrumentTypeVar_co], # noqa: UP046 -- Generic kept because multi-inheritance with type params is not yet supported ): """ A gettable parameter that returns an array of values. diff --git a/src/qcodes/parameters/command.py b/src/qcodes/parameters/command.py index 5a2ddf5287d7..bf59cd6b8633 100644 --- a/src/qcodes/parameters/command.py +++ b/src/qcodes/parameters/command.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Generic, Literal, TypeVar +from typing import TYPE_CHECKING, Any, Literal, TypeVar from qcodes.utils import is_function @@ -16,7 +16,7 @@ class NoCommandError(Exception): ParsedOutput = TypeVar("ParsedOutput") -class Command(Generic[Output, ParsedOutput]): +class Command[Output, ParsedOutput]: """ Create a callable command from a string or function. diff --git a/src/qcodes/parameters/delegate_parameter.py b/src/qcodes/parameters/delegate_parameter.py index 0a409a6335bf..973136366f68 100644 --- a/src/qcodes/parameters/delegate_parameter.py +++ b/src/qcodes/parameters/delegate_parameter.py @@ -36,7 +36,7 @@ class DelegateParameter( Parameter[ParameterDataTypeVar, InstrumentTypeVar_co], - Generic[ParameterDataTypeVar, InstrumentTypeVar_co], + Generic[ParameterDataTypeVar, InstrumentTypeVar_co], # noqa: UP046 -- Generic kept because multi-inheritance with type params is not yet supported ): """ The :class:`.DelegateParameter` wraps a given `source` :class:`Parameter`. diff --git a/src/qcodes/parameters/multi_channel_instrument_parameter.py b/src/qcodes/parameters/multi_channel_instrument_parameter.py index b4a8f3af1d47..1e28dbda9909 100644 --- a/src/qcodes/parameters/multi_channel_instrument_parameter.py +++ b/src/qcodes/parameters/multi_channel_instrument_parameter.py @@ -2,7 +2,7 @@ import logging import warnings -from typing import TYPE_CHECKING, Any, ClassVar, Generic, TypeVar +from typing import TYPE_CHECKING, Any, ClassVar, TypeVar from qcodes.utils import QCoDeSDeprecationWarning @@ -19,7 +19,9 @@ _LOG = logging.getLogger(__name__) -class MultiChannelInstrumentParameter(MultiParameter, Generic[InstrumentModuleType]): +class MultiChannelInstrumentParameter[InstrumentModuleType: "InstrumentModule"]( + MultiParameter +): """ Parameter to get or set multiple channels simultaneously. diff --git a/src/qcodes/parameters/multi_parameter.py b/src/qcodes/parameters/multi_parameter.py index 613995f5fe0e..7574de2e8ec9 100644 --- a/src/qcodes/parameters/multi_parameter.py +++ b/src/qcodes/parameters/multi_parameter.py @@ -52,7 +52,7 @@ def _is_nested_sequence_or_none( class MultiParameter( ParameterBase[ParameterDataTypeVar, InstrumentTypeVar_co], - Generic[ParameterDataTypeVar, InstrumentTypeVar_co], + Generic[ParameterDataTypeVar, InstrumentTypeVar_co], # noqa: UP046 -- Generic kept because multi-inheritance with type params is not yet supported ): """ A gettable parameter that returns multiple values with separate names, diff --git a/src/qcodes/parameters/parameter.py b/src/qcodes/parameters/parameter.py index 12928f61c56f..85b089eeddb9 100644 --- a/src/qcodes/parameters/parameter.py +++ b/src/qcodes/parameters/parameter.py @@ -34,7 +34,7 @@ class Parameter( ParameterBase[ParameterDataTypeVar, InstrumentTypeVar_co], - Generic[ParameterDataTypeVar, InstrumentTypeVar_co], + Generic[ParameterDataTypeVar, InstrumentTypeVar_co], # noqa: UP046 -- Generic kept because multi-inheritance with type params is not yet supported ): """ A parameter represents a single degree of freedom. Most often, diff --git a/src/qcodes/parameters/parameter_base.py b/src/qcodes/parameters/parameter_base.py index 1b76f56fe38a..cc0f6e076806 100644 --- a/src/qcodes/parameters/parameter_base.py +++ b/src/qcodes/parameters/parameter_base.py @@ -1483,7 +1483,7 @@ def __call__(self) -> ParameterDataTypeVar: # Does not implement __hash__, not clear it needs to -class ParameterSet(MutableSet[P], Generic[P]): # noqa: PLW1641 +class ParameterSet[P: ParameterBase](MutableSet[P]): # noqa: PLW1641 """A set-like container that preserves the insertion order of its parameters. This class implements the common set interface methods while maintaining diff --git a/src/qcodes/parameters/parameter_with_setpoints.py b/src/qcodes/parameters/parameter_with_setpoints.py index 6bdf14e85b19..04ac2ebb1d9b 100644 --- a/src/qcodes/parameters/parameter_with_setpoints.py +++ b/src/qcodes/parameters/parameter_with_setpoints.py @@ -27,7 +27,7 @@ class ParameterWithSetpoints( Parameter[ParameterDataTypeVar, InstrumentTypeVar_co], - Generic[ParameterDataTypeVar, InstrumentTypeVar_co], + Generic[ParameterDataTypeVar, InstrumentTypeVar_co], # noqa: UP046 -- Generic kept because multi-inheritance with type params is not yet supported ): """ A parameter that has associated setpoints. The setpoints is nothing diff --git a/src/qcodes/parameters/val_mapping.py b/src/qcodes/parameters/val_mapping.py index d8076179616e..f79a715e8760 100644 --- a/src/qcodes/parameters/val_mapping.py +++ b/src/qcodes/parameters/val_mapping.py @@ -6,7 +6,7 @@ T = TypeVar("T") -def create_on_off_val_mapping( +def create_on_off_val_mapping[T]( on_val: T | bool = True, off_val: T | bool = False ) -> OrderedDict[str | bool, T | bool]: """ diff --git a/src/qcodes/utils/deep_update_utils.py b/src/qcodes/utils/deep_update_utils.py index 6090293e2c44..107d9308fd13 100644 --- a/src/qcodes/utils/deep_update_utils.py +++ b/src/qcodes/utils/deep_update_utils.py @@ -7,7 +7,7 @@ L = TypeVar("L", bound=Hashable) -def deep_update( +def deep_update[K: Hashable, L: Hashable]( dest: MutableMapping[K, Any], update: Mapping[L, Any] ) -> MutableMapping[K | L, Any]: """ diff --git a/src/qcodes/utils/threading_utils.py b/src/qcodes/utils/threading_utils.py index 552c51e79a72..b67f5ed83efe 100644 --- a/src/qcodes/utils/threading_utils.py +++ b/src/qcodes/utils/threading_utils.py @@ -1,6 +1,6 @@ import logging import threading -from typing import TYPE_CHECKING, Any, Generic, Optional, TypeVar +from typing import TYPE_CHECKING, Any, Optional, TypeVar if TYPE_CHECKING: from collections.abc import Callable, Sequence @@ -10,7 +10,7 @@ T = TypeVar("T") -class RespondingThread(threading.Thread, Generic[T]): +class RespondingThread[T](threading.Thread): """ Thread subclass for parallelizing execution. Behaves like a regular thread but returns a value from target, and propagates diff --git a/src/qcodes/utils/types.py b/src/qcodes/utils/types.py index 0f0fb0fd5b52..e522a4be3389 100644 --- a/src/qcodes/utils/types.py +++ b/src/qcodes/utils/types.py @@ -85,7 +85,7 @@ concrete_complex_types = (*numpy_concrete_complex, complex) complex_types = (*numpy_concrete_complex, complex) -NumberType: TypeAlias = int | float | np.integer | np.floating +NumberType: TypeAlias = int | float | np.integer | np.floating # noqa: UP040 -- TypeAlias kept because `type` aliases cannot be used as base classes or in isinstance() """ Python or NumPy real number. """ diff --git a/src/qcodes/validators/validators.py b/src/qcodes/validators/validators.py index 37beb98fbf83..a3ac3e726d86 100644 --- a/src/qcodes/validators/validators.py +++ b/src/qcodes/validators/validators.py @@ -9,7 +9,7 @@ import typing from collections import abc from collections.abc import Hashable -from typing import Any, Generic, Literal, TypeVar, cast, get_args +from typing import Any, Literal, TypeVar, cast, get_args import numpy as np import numpy.typing as npt @@ -65,7 +65,7 @@ def range_str( T = TypeVar("T") -class Validator(Generic[T]): +class Validator[T]: """ Base class for all value validators each validator should implement: diff --git a/tests/common.py b/tests/common.py index 3d2ea62c3f11..0c2da5080b9a 100644 --- a/tests/common.py +++ b/tests/common.py @@ -78,7 +78,7 @@ def func_retry(*args: P.args, **kwargs: P.kwargs) -> T: return retry_until_passes_decorator -def profile(func: Callable[P, T]) -> Callable[P, T]: +def profile[**P, T](func: Callable[P, T]) -> Callable[P, T]: """ Decorator that profiles the wrapped function with cProfile. diff --git a/tests/test_channels.py b/tests/test_channels.py index 9c5cb18f0ae7..b15567a5ec8c 100644 --- a/tests/test_channels.py +++ b/tests/test_channels.py @@ -20,8 +20,9 @@ ) if TYPE_CHECKING: + from typing import Unpack + import pytest_mock - from typing_extensions import Unpack from qcodes.instrument.instrument_base import InstrumentBaseKWArgs