From e6ae9134c4d48c9a68c1f14bd8f107bc5435f8c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 09:45:15 -0700 Subject: [PATCH] python-deps(deps-dev): bump the python-dependencies group with 2 updates (#238) * python-deps(deps-dev): bump the python-dependencies group with 2 updates Updates the requirements on [pyright](https://github.com/RobertCraigie/pyright-python) and [ruff](https://github.com/astral-sh/ruff) to permit the latest version. Updates `pyright` to 1.1.367 - [Release notes](https://github.com/RobertCraigie/pyright-python/releases) - [Commits](https://github.com/RobertCraigie/pyright-python/compare/v1.1.366...v1.1.367) Updates `ruff` to 0.4.9 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.4.8...v0.4.9) --- updated-dependencies: - dependency-name: pyright dependency-type: direct:development dependency-group: python-dependencies - dependency-name: ruff dependency-type: direct:development dependency-group: python-dependencies ... Signed-off-by: dependabot[bot] * ci: Update python linters and pre-commit dependencies. * ci: Install up-to-date version of node when building docs * refactor: Update the docstrings of the DeviceManager to better indicate what the adder/getter methods create/fetch --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tektronix Bot Co-authored-by: Nicholas Felt --- .github/workflows/test-code.yml | 2 +- .github/workflows/test-docs.yml | 7 +++ .pre-commit-config.yaml | 4 +- docs/requirements.txt | 4 +- pyproject.toml | 6 +-- src/tm_devices/device_manager.py | 82 ++++++++++++++++---------------- tests/requirements.txt | 4 +- 7 files changed, 58 insertions(+), 51 deletions(-) diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml index 8c64a219..c1be1100 100644 --- a/.github/workflows/test-code.yml +++ b/.github/workflows/test-code.yml @@ -39,7 +39,7 @@ jobs: - if: ${{ inputs.node-version }} name: Install non-python documentation dependencies run: | - npm install -g @mermaid-js/mermaid-cli + npm install --global @mermaid-js/mermaid-cli sudo apt install --no-install-recommends --assume-yes graphviz - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index e9d47758..4ea312b9 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -20,6 +20,13 @@ jobs: tox_env: [docs, doctests] steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 # The node version needs to stay in sync with .readthedocs.yml + - name: Install non-python documentation dependencies + run: | + npm install --global @mermaid-js/mermaid-cli + sudo apt install --no-install-recommends --assume-yes graphviz - name: Set up Python uses: actions/setup-python@v5 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index afac23b1..077da65e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: - id: remove-tabs - id: forbid-tabs - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.28.4 + rev: 0.28.5 hooks: - id: check-readthedocs - id: check-dependabot @@ -142,7 +142,7 @@ repos: always_run: true args: [audit, --json, --ignore-code=CVE-2019-8341] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.8 + rev: v0.4.9 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/docs/requirements.txt b/docs/requirements.txt index af7b40bd..2f35cd9a 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -10,7 +10,7 @@ colorama==0.4.6 ; python_version >= "3.8" and python_version < "4.0" editdistpy==0.1.4 ; python_version >= "3.8" and python_version < "4.0" editorconfig==0.12.4 ; python_version >= "3.8" and python_version < "4.0" ghp-import==2.1.0 ; python_version >= "3.8" and python_version < "4.0" -griffe==0.45.3 ; python_version >= "3.8" and python_version < "4.0" +griffe==0.46.1 ; python_version >= "3.8" and python_version < "4.0" idna==3.7 ; python_version >= "3.8" and python_version < "4.0" importlib-metadata==7.1.0 ; python_version >= "3.8" and python_version < "3.10" jinja2==3.1.4 ; python_version >= "3.8" and python_version < "4.0" @@ -48,7 +48,7 @@ symspellpy==6.7.7 ; python_version >= "3.8" and python_version < "4.0" termcolor==2.4.0 ; python_version >= "3.8" and python_version < "4.0" tomli==2.0.1 ; python_version >= "3.8" and python_version < "4.0" typing-extensions==4.12.2 ; python_version >= "3.8" and python_version < "3.11" -urllib3==2.2.1 ; python_version >= "3.8" and python_version < "4.0" +urllib3==2.2.2 ; python_version >= "3.8" and python_version < "4.0" watchdog==4.0.1 ; python_version >= "3.8" and python_version < "4.0" wcmatch==8.5.2 ; python_version >= "3.8" and python_version < "4.0" wheel==0.43.0 ; python_version >= "3.8" and python_version < "3.9" diff --git a/pyproject.toml b/pyproject.toml index 61952aee..2efb0bb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -112,10 +112,10 @@ pre-commit = [ pre-commit-update = "^0.3.0" pyclean = "^3.0.0" pylint = "3.2.3" -pyright = "1.1.366" +pyright = "1.1.367" pyroma = "^4.2" python-semantic-release = "^9.6.0" -ruff = "0.4.8" +ruff = "0.4.9" safety = "^3.2.0" toml-sort = "^0.23.0" tox = "^4.0" @@ -159,7 +159,7 @@ pytest-env = "^1.1.3" pytest-github-report = "^0.0.1" pytest-html = "^4.1.1" pytest-order = "^1.2.1" -ruff = "0.4.8" +ruff = "0.4.9" tomli = "^2.0.1" [tool.poetry.scripts] diff --git a/src/tm_devices/device_manager.py b/src/tm_devices/device_manager.py index 39263d62..e98bff52 100644 --- a/src/tm_devices/device_manager.py +++ b/src/tm_devices/device_manager.py @@ -68,31 +68,31 @@ # Type Aliases #################################################################################################### AFGAlias = TypeVar("AFGAlias", bound=AFG, default=AFG) # pylint: disable=unexpected-keyword-arg,useless-suppression # TODO: remove pylint disable statement -"""An alias to a specific AFG driver.""" +"""An alias to a specific Arbitrary Function Generator Python driver.""" AWGAlias = TypeVar("AWGAlias", bound=AWG, default=AWG) # pylint: disable=unexpected-keyword-arg,useless-suppression # TODO: remove pylint disable statement -"""An alias to a specific AWG driver.""" +"""An alias to a specific Arbitrary Waveform Generator Python driver.""" DataAcquisitionSystemAlias = TypeVar( # pylint: disable=unexpected-keyword-arg,useless-suppression # TODO: remove pylint disable statement "DataAcquisitionSystemAlias", bound=DataAcquisitionSystem, default=DataAcquisitionSystem ) -"""An alias to a specific DataAcquisitionSystem driver.""" +"""An alias to a specific Data Acquisition System Python driver.""" DigitalMultimeterAlias = TypeVar( # pylint: disable=unexpected-keyword-arg,useless-suppression # TODO: remove pylint disable statement "DigitalMultimeterAlias", bound=DigitalMultimeter, default=DigitalMultimeter ) -"""An alias to a specific DigitalMultimeter driver.""" +"""An alias to a specific Digital Multimeter Python driver.""" ScopeAlias = TypeVar("ScopeAlias", bound=Scope, default=Scope) # pylint: disable=unexpected-keyword-arg,useless-suppression # TODO: remove pylint disable statement """An alias to a specific Scope driver.""" MarginTesterAlias = TypeVar("MarginTesterAlias", bound=MarginTester, default=MarginTester) # pylint: disable=unexpected-keyword-arg,useless-suppression # TODO: remove pylint disable statement -"""An alias to a specific MarginTester driver.""" +"""An alias to a specific Margin Tester Python driver.""" PowerSupplyUnitAlias = TypeVar( # pylint: disable=unexpected-keyword-arg,useless-suppression # TODO: remove pylint disable statement "PowerSupplyUnitAlias", bound=PowerSupplyUnit, default=PowerSupplyUnit ) -"""An alias to a specific PowerSupplyUnit driver.""" +"""An alias to a specific Power Supply Unit Python driver.""" SourceMeasureUnitAlias = TypeVar( # pylint: disable=unexpected-keyword-arg,useless-suppression # TODO: remove pylint disable statement "SourceMeasureUnitAlias", bound=SourceMeasureUnit, default=SourceMeasureUnit ) -"""An alias to a specific SourceMeasureUnit driver.""" +"""An alias to a specific Source Measure Unit Python driver.""" SystemsSwitchAlias = TypeVar("SystemsSwitchAlias", bound=SystemsSwitch, default=SystemsSwitch) # pylint: disable=unexpected-keyword-arg,useless-suppression # TODO: remove pylint disable statement -"""An alias to a specific SystemsSwitch driver.""" +"""An alias to a specific Systems Switch Python driver.""" #################################################################################################### @@ -262,7 +262,7 @@ def add_afg( serial_config: Optional[SerialConfig] = None, gpib_board_number: Optional[int] = None, ) -> AFGAlias: - """Add an AFG to the DeviceManager. + """Add an Arbitrary Function Generator to the DeviceManager. Args: address: The address of the AFG, either an IP address or hostname. If the connection @@ -278,7 +278,7 @@ def add_afg( when making a GPIB connection (defaults to 0). Returns: - The AFG device driver. + The Arbitrary Function Generator device driver. """ self.__protect_access() return cast( @@ -304,7 +304,7 @@ def add_awg( serial_config: Optional[SerialConfig] = None, gpib_board_number: Optional[int] = None, ) -> AWGAlias: - """Add an AWG to the DeviceManager. + """Add an Arbitrary Waveform Generator to the DeviceManager. Args: address: The address of the AWG, either an IP address or hostname. If the connection @@ -320,7 +320,7 @@ def add_awg( when making a GPIB connection (defaults to 0). Returns: - The AWG device driver. + The Arbitrary Waveform Generator device driver. """ self.__protect_access() return cast( @@ -346,7 +346,7 @@ def add_daq( serial_config: Optional[SerialConfig] = None, gpib_board_number: Optional[int] = None, ) -> DataAcquisitionSystemAlias: - """Add a DAQ to the DeviceManager. + """Add a Data Acquisition System to the DeviceManager. Args: address: The address of the DAQ, either an IP address or hostname. If the connection @@ -362,7 +362,7 @@ def add_daq( when making a GPIB connection (defaults to 0). Returns: - The DAQ device driver. + The Data Acquisition System device driver. """ self.__protect_access() return cast( @@ -388,7 +388,7 @@ def add_dmm( serial_config: Optional[SerialConfig] = None, gpib_board_number: Optional[int] = None, ) -> DigitalMultimeterAlias: - """Add a DMM to the DeviceManager. + """Add a Digital Multimeter to the DeviceManager. Args: address: The address of the DMM, either an IP address or hostname. If the connection @@ -404,7 +404,7 @@ def add_dmm( when making a GPIB connection (defaults to 0). Returns: - The DMM device driver. + The Digital Multimeter device driver. """ self.__protect_access() return cast( @@ -463,7 +463,7 @@ def add_psu( serial_config: Optional[SerialConfig] = None, gpib_board_number: Optional[int] = None, ) -> PowerSupplyUnitAlias: - """Add a PSU to the DeviceManager. + """Add a Power Supply Unit to the DeviceManager. Args: address: The address of the PSU, either an IP address or hostname. If the connection @@ -479,7 +479,7 @@ def add_psu( when making a GPIB connection (defaults to 0). Returns: - The PSU device driver. + The Power Supply Unit device driver. """ self.__protect_access() return cast( @@ -547,7 +547,7 @@ def add_smu( serial_config: Optional[SerialConfig] = None, gpib_board_number: Optional[int] = None, ) -> SourceMeasureUnitAlias: - """Add a SMU to the DeviceManager. + """Add a Source Measure Unit to the DeviceManager. Args: address: The address of the device, either an IP address or hostname. If the connection @@ -563,7 +563,7 @@ def add_smu( when making a GPIB connection (defaults to 0). Returns: - The SMU device driver. + The Source Measure Unit device driver. """ self.__protect_access() return cast( @@ -588,13 +588,13 @@ def add_ss( port: Optional[int] = None, gpib_board_number: Optional[int] = None, ) -> SystemsSwitchAlias: - """Add a SS to the DeviceManager. + """Add a Systems Switch to the DeviceManager. Args: address: The address of the device, either an IP address or hostname. If the connection type is ``"USB"`` then the address must be specified as ``"-"``. - alias: An optional alias to use to refer to the SS. If no alias is provided, - the device type and number can be used to access the SS instead. + alias: An optional alias to use to refer to the Systems Switch. If no alias is provided, + the device type and number can be used to access the Systems Switch instead. connection_type: The type of connection to use for VISA, defaults to TCPIP, not needed when the address is a visa resource expression since the connection type is parsed from the address string. @@ -603,7 +603,7 @@ def add_ss( when making a GPIB connection (defaults to 0). Returns: - The SS device driver. + The Systems Switch device driver. """ self.__protect_access() return cast( @@ -698,7 +698,7 @@ def get_available_devices( return found_devices def get_afg(self, number_or_alias: Union[int, str]) -> AFGAlias: - """Get the AFG driver for the given AFG number or alias. + """Get the Arbitrary Function Generator Python driver for the given AFG number or alias. Integers are treated as a device number, strings are treated as an alias. @@ -706,7 +706,7 @@ def get_afg(self, number_or_alias: Union[int, str]) -> AFGAlias: number_or_alias: The number or alias of the AFG to get. Returns: - The AFG device driver. + The Arbitrary Function Generator device driver. """ self.__protect_access() if isinstance(number_or_alias, int): @@ -719,7 +719,7 @@ def get_afg(self, number_or_alias: Union[int, str]) -> AFGAlias: ) def get_awg(self, number_or_alias: Union[int, str]) -> AWGAlias: - """Get the AWG driver for the given AWG number or alias. + """Get the Arbitrary Waveform Generator Python driver for the given AWG number or alias. Integers are treated as a device number, strings are treated as an alias. @@ -727,7 +727,7 @@ def get_awg(self, number_or_alias: Union[int, str]) -> AWGAlias: number_or_alias: The number or alias of the AWG to get. Returns: - The AWG device driver. + The Arbitrary Waveform Generator device driver. """ self.__protect_access() if isinstance(number_or_alias, int): @@ -740,15 +740,15 @@ def get_awg(self, number_or_alias: Union[int, str]) -> AWGAlias: ) def get_daq(self, number_or_alias: Union[int, str]) -> DataAcquisitionSystemAlias: - """Get the DAQ driver for the given scope number or alias. + """Get the Data Acquisition System Python driver for the given DAQ number or alias. Integers are treated as a device number, strings are treated as an alias. Args: - number_or_alias: The number or alias of the scope to get. + number_or_alias: The number or alias of the DAQ to get. Returns: - The scope device driver. + The Data Acquisition System device driver. """ self.__protect_access() if isinstance(number_or_alias, int): @@ -762,7 +762,7 @@ def get_daq(self, number_or_alias: Union[int, str]) -> DataAcquisitionSystemAlia ) def get_dmm(self, number_or_alias: Union[int, str]) -> DigitalMultimeterAlias: - """Get the DMM driver for the given DMM number or alias. + """Get the Digital Multimeter Python driver for the given DMM number or alias. Integers are treated as a device number, strings are treated as an alias. @@ -770,7 +770,7 @@ def get_dmm(self, number_or_alias: Union[int, str]) -> DigitalMultimeterAlias: number_or_alias: The number or alias of the DMM to get. Returns: - The DMM device driver. + The Digital Multimeter device driver. """ self.__protect_access() if isinstance(number_or_alias, int): @@ -828,7 +828,7 @@ def get_device( return device def get_mt(self, number_or_alias: Union[int, str]) -> MarginTesterAlias: - """Get the Margin Tester driver for the given Margin Tester number or alias. + """Get the Margin Tester Python driver for the given Margin Tester number or alias. Integers are treated as a device number, strings are treated as an alias. @@ -850,7 +850,7 @@ def get_mt(self, number_or_alias: Union[int, str]) -> MarginTesterAlias: ) def get_psu(self, number_or_alias: Union[int, str]) -> PowerSupplyUnitAlias: - """Get the PSU driver for the given PSU number or alias. + """Get the Power Supply Unit Python driver for the given PSU number or alias. Integers are treated as a device number, strings are treated as an alias. @@ -858,7 +858,7 @@ def get_psu(self, number_or_alias: Union[int, str]) -> PowerSupplyUnitAlias: number_or_alias: The number or alias of the PSU to get. Returns: - The PSU device driver. + The Power Supply Unit device driver. """ self.__protect_access() if isinstance(number_or_alias, int): @@ -893,7 +893,7 @@ def get_scope(self, number_or_alias: Union[int, str]) -> ScopeAlias: ) def get_smu(self, number_or_alias: Union[int, str]) -> SourceMeasureUnitAlias: - """Get the SMU driver for the given SMU number or alias. + """Get the Source Measure Unit Python driver for the given SMU number or alias. Integers are treated as a device number, strings are treated as an alias. @@ -901,7 +901,7 @@ def get_smu(self, number_or_alias: Union[int, str]) -> SourceMeasureUnitAlias: number_or_alias: The number or alias of the SMU to get. Returns: - The SMU device driver. + The Source Measure Unit device driver. """ self.__protect_access() if isinstance(number_or_alias, int): @@ -915,15 +915,15 @@ def get_smu(self, number_or_alias: Union[int, str]) -> SourceMeasureUnitAlias: ) def get_ss(self, number_or_alias: Union[int, str]) -> SystemsSwitchAlias: - """Get the SS driver for the given SS number or alias. + """Get the Systems Switch Python driver for the given Systems Switch number or alias. Integers are treated as a device number, strings are treated as an alias. Args: - number_or_alias: The number or alias of the SS to get. + number_or_alias: The number or alias of the Systems Switch to get. Returns: - The SS device driver. + The Systems Switch device driver. """ self.__protect_access() if isinstance(number_or_alias, int): diff --git a/tests/requirements.txt b/tests/requirements.txt index a7116995..677ff5f8 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -38,7 +38,7 @@ pytest-order==1.2.1 ; python_version >= "3.8" and python_version < "4.0" python-dateutil==2.9.0.post0 ; python_version >= "3.8" and python_version < "4.0" pytz==2024.1 ; python_version >= "3.8" and python_version < "4.0" requests==2.32.3 ; python_version >= "3.8" and python_version < "4.0" -ruff==0.4.8 ; python_version >= "3.8" and python_version < "4.0" +ruff==0.4.9 ; python_version >= "3.8" and python_version < "4.0" setuptools==70.0.0 ; python_version >= "3.8" and python_version < "4.0" six==1.16.0 ; python_version >= "3.8" and python_version < "4.0" soupsieve==2.5 ; python_version >= "3.8" and python_version < "4.0" @@ -47,6 +47,6 @@ tcolorpy==0.1.6 ; python_version >= "3.8" and python_version < "4.0" tomli==2.0.1 ; python_version >= "3.8" and python_version < "4.0" typepy==1.3.2 ; python_version >= "3.8" and python_version < "4.0" typepy[datetime]==1.3.2 ; python_version >= "3.8" and python_version < "4.0" -urllib3==2.2.1 ; python_version >= "3.8" and python_version < "4.0" +urllib3==2.2.2 ; python_version >= "3.8" and python_version < "4.0" werkzeug==3.0.3 ; python_version >= "3.8" and python_version < "4.0" zipp==3.19.2 ; python_version >= "3.8" and python_version < "3.10"