Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-deps(deps-dev): bump the python-dependencies group with 2 updates #238

Merged
merged 5 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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]
Expand Down
82 changes: 41 additions & 41 deletions src/tm_devices/device_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""


####################################################################################################
Expand Down Expand Up @@ -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
Expand All @@ -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(
Expand All @@ -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
Expand All @@ -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(
Expand All @@ -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
Expand All @@ -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(
Expand All @@ -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
Expand All @@ -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(
Expand Down Expand Up @@ -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
Expand All @@ -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(
Expand Down Expand Up @@ -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
Expand All @@ -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(
Expand All @@ -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 ``"<model>-<serial>"``.
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.
Expand All @@ -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(
Expand Down Expand Up @@ -698,15 +698,15 @@ 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.

Args:
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):
Expand All @@ -719,15 +719,15 @@ 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.

Args:
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):
Expand All @@ -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):
Expand All @@ -762,15 +762,15 @@ 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.

Args:
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):
Expand Down Expand Up @@ -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.

Expand All @@ -850,15 +850,15 @@ 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.

Args:
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):
Expand Down Expand Up @@ -893,15 +893,15 @@ 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.

Args:
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):
Expand All @@ -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):
Expand Down
Loading
Loading