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): update ruff requirement from 0.7.4 to 0.8.0 in the python-dependencies group #355

Merged
merged 4 commits into from
Nov 25, 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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ repos:
always_run: true
args: [audit, --json, --ignore-code=CVE-2019-8341]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: cafecb2f683a620516412e109877570ca7648cbd # frozen: v0.7.4
rev: 0710b94280408eef12748cde4782972942370ad2 # frozen: v0.8.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
click {{ base.path }} href "" "{{ base.path }}"
{% endfor %}
</div>
<script>
let diagram = document.getElementById('mermaid-diagram-{{ class.path }}');
<!--suppress ES6ConvertVarToLetConst -->
<script>
var diagram = document.getElementById('mermaid-diagram-{{ class.path }}');
diagram.innerHTML = diagram.innerHTML.replace(/click ([\w.]+) href "" "\1"/g, function(match, nodeID, offset) {
try {
const link = document.getElementById("mermaid-link-" + nodeID).href;
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ typing-extensions==4.12.2 ; python_version >= "3.8" and python_version < "4.0"
urllib3==2.2.3 ; python_version >= "3.8" and python_version < "4.0"
watchdog==4.0.2 ; python_version >= "3.8" and python_version < "4.0"
wcmatch==10.0 ; python_version >= "3.8" and python_version < "4.0"
wheel==0.45.0 ; python_version >= "3.8" and python_version < "3.9"
wheel==0.45.1 ; python_version >= "3.8" and python_version < "3.9"
zipp==3.20.2 ; python_version >= "3.8" and python_version < "3.10"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ pytest-env = "^1.1.3"
pytest-github-report = "^0.0.1"
pytest-html = "^4.1.1"
pytest-order = "^1.2.1"
ruff = "0.7.4"
ruff = "0.8.0"

[tool.poetry.scripts]
list-visa-resources = "tm_devices:print_available_visa_devices"
Expand Down
8 changes: 4 additions & 4 deletions src/tm_devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@


__all__ = [
"configure_logging",
"PYVISA_PY_BACKEND",
"SYSTEM_DEFAULT_VISA_BACKEND",
"DeviceManager",
"LoggingLevels",
"SupportedModels",
"configure_logging",
"print_available_visa_devices",
"PYVISA_PY_BACKEND",
"register_additional_usbtmc_mapping",
"SupportedModels",
"SYSTEM_DEFAULT_VISA_BACKEND",
]
30 changes: 15 additions & 15 deletions src/tm_devices/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,27 @@
"AFG3KCommandConstants",
"AFG3KCommands",
"AFG3KMixin",
"AWG5200CommandConstants",
"AWG5200Commands",
"AWG5200Mixin",
"AWG5KCCommandConstants",
"AWG5KCCommands",
"AWG5KCMixin",
"AWG5KCommandConstants",
"AWG5KCommands",
"AWG5KMixin",
"AWG70KACommandConstants",
"AWG70KACommands",
"AWG70KAMixin",
"AWG70KBCommandConstants",
"AWG70KBCommands",
"AWG70KBMixin",
"AWG7KCCommandConstants",
"AWG7KCCommands",
"AWG7KCMixin",
"AWG7KCommandConstants",
"AWG7KCommands",
"AWG7KMixin",
"AWG70KACommandConstants",
"AWG70KACommands",
"AWG70KAMixin",
"AWG70KBCommandConstants",
"AWG70KBCommands",
"AWG70KBMixin",
"AWG5200CommandConstants",
"AWG5200Commands",
"AWG5200Mixin",
"DAQ6510CommandConstants",
"DAQ6510Commands",
"DAQ6510Mixin",
Expand Down Expand Up @@ -137,6 +137,12 @@
"DPO5KCommandConstants",
"DPO5KCommands",
"DPO5KMixin",
"DPO7KCCommandConstants",
"DPO7KCCommands",
"DPO7KCMixin",
"DPO7KCommandConstants",
"DPO7KCommands",
"DPO7KMixin",
"DPO70KCCommandConstants",
"DPO70KCCommands",
"DPO70KCMixin",
Expand All @@ -149,12 +155,6 @@
"DPO70KSXCommandConstants",
"DPO70KSXCommands",
"DPO70KSXMixin",
"DPO7KCCommandConstants",
"DPO7KCCommands",
"DPO7KCMixin",
"DPO7KCommandConstants",
"DPO7KCommands",
"DPO7KMixin",
"DSA70KCCommandConstants",
"DSA70KCCommands",
"DSA70KCMixin",
Expand Down
2 changes: 1 addition & 1 deletion src/tm_devices/driver_mixins/device_control/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from .rest_api_control import RESTAPIControl
from .tsp_control import TSPControl

__all__ = ["PIControl", "TSPControl", "RESTAPIControl"]
__all__ = ["PIControl", "RESTAPIControl", "TSPControl"]
7 changes: 2 additions & 5 deletions src/tm_devices/driver_mixins/device_control/pi_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,8 @@ def poll_query( # noqa: PLR0913 # pylint: disable=too-many-locals
<= float(wanted_val) + tolerance
)
str_comparison = isinstance(wanted_val, str) and queried_value == wanted_val
if (
not invert_range
and (float_comparison or str_comparison)
or invert_range
and not (float_comparison or str_comparison)
if (not invert_range and (float_comparison or str_comparison)) or (
invert_range and not (float_comparison or str_comparison)
):
return
time.sleep(sleep_time)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"CommonPISystemErrorCheckMixin",
"CommonTSPErrorCheckMixin",
"IEEE4882Commands",
"TSPIEEE4882Commands",
"LegacyTSPIEEE4882Commands",
"TSPIEEE4882Commands",
]
76 changes: 38 additions & 38 deletions src/tm_devices/drivers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,10 @@


__all__ = [
"SupportedModels",
"AFG3K",
"AFG3KB",
"AFG3KC",
"AFG31K",
"AWG5200",
"AWG5K",
"AWG5KB",
"AWG5KC",
Expand All @@ -119,7 +117,15 @@
"AWG7KC",
"AWG70KA",
"AWG70KB",
"AWG5200",
"DAQ6510",
"DMM6500",
"DMM7510",
"DMM7512",
"DPO2K",
"DPO2KB",
"DPO4K",
"DPO4KB",
"DPO5K",
"DPO5KB",
"DPO7K",
Expand All @@ -133,35 +139,35 @@
"DSA70KC",
"DSA70KD",
"LPD6",
"MSO2",
"MSO4",
"MSO4B",
"MSO5",
"MSO5B",
"MSO5LP",
"MSO6",
"MSO6B",
"MSO2K",
"MSO2KB",
"DPO2K",
"DPO2KB",
"MDO3",
"MDO3K",
"MDO4K",
"MDO4KB",
"MDO4KC",
"MSO2",
"MSO2K",
"MSO2KB",
"MSO4",
"MSO4B",
"MSO4K",
"MSO4KB",
"DPO4K",
"DPO4KB",
"MSO5",
"MSO5B",
"MSO5K",
"MSO5KB",
"MSO5LP",
"MSO6",
"MSO6B",
"MSO70K",
"MSO70KC",
"MSO70KDX",
"TekScopePC",
"TSOVu",
"TMT4",
"PSU2200",
"PSU2220",
"PSU2230",
"PSU2231",
"PSU2231A",
"PSU2280",
"PSU2281",
"SMU2400",
"SMU2401",
"SMU2410",
Expand All @@ -170,39 +176,33 @@
"SMU2461",
"SMU2470",
"SMU2601A",
"SMU2602A",
"SMU2604A",
"SMU2611A",
"SMU2612A",
"SMU2614A",
"SMU2634A",
"SMU2635A",
"SMU2636A",
"SMU2601B",
"SMU2601BPulse",
"SMU2602A",
"SMU2602B",
"SMU2604A",
"SMU2604B",
"SMU2606B",
"SMU2611A",
"SMU2611B",
"SMU2612A",
"SMU2612B",
"SMU2614A",
"SMU2614B",
"SMU2634A",
"SMU2634B",
"SMU2635A",
"SMU2635B",
"SMU2636A",
"SMU2636B",
"SMU2651A",
"SMU2657A",
"SMU6430",
"SMU6514",
"SMU6517B",
"PSU2200",
"PSU2220",
"PSU2230",
"PSU2231",
"PSU2231A",
"PSU2280",
"PSU2281",
"DMM6500",
"DMM7510",
"DMM7512",
"SS3706A",
"TMT4",
"SMU2601BPulse",
"SupportedModels",
"TSOVu",
"TekScopePC",
]
36 changes: 18 additions & 18 deletions src/tm_devices/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,42 +43,42 @@
from tm_devices.helpers.verification_functions import raise_error, raise_failure, verify_values

__all__ = [
"PACKAGE_NAME",
"PYVISA_PY_BACKEND",
"SYSTEM_DEFAULT_VISA_BACKEND",
"USB_MODEL_ID_LOOKUP",
"VALID_DEVICE_CONNECTION_TYPES",
"VISA_RESOURCE_EXPRESSION_REGEX",
"AliasDict",
"ConfigFileType",
"ConnectionTypes",
"DMConfigOptions",
"DeviceConfigEntry",
"DeviceTypes",
"LoadImpedanceAFG",
"LoggingLevels",
"ReadOnlyCachedProperty",
"SASSetWaveformFileTypes",
"SerialConfig",
"Singleton",
"SupportedModels",
"SupportedRequestTypes",
"USBTMCConfiguration",
"check_for_update",
"check_network_connection",
"check_port_connection",
"check_visa_connection",
"configure_logging",
"create_visa_connection",
"detect_visa_resource_expression",
"DeviceConfigEntry",
"DeviceTypes",
"DMConfigOptions",
"get_model_series",
"get_version",
"get_visa_backend",
"LoggingLevels",
"PACKAGE_NAME",
"ping_address",
"PYVISA_PY_BACKEND",
"raise_error",
"raise_failure",
"register_additional_usbtmc_mapping",
"sanitize_enum",
"SerialConfig",
"Singleton",
"SupportedModels",
"SupportedRequestTypes",
"SYSTEM_DEFAULT_VISA_BACKEND",
"USB_MODEL_ID_LOOKUP",
"USBTMCConfiguration",
"VALID_DEVICE_CONNECTION_TYPES",
"validate_address",
"verify_values",
"VISA_RESOURCE_EXPRESSION_REGEX",
"ReadOnlyCachedProperty",
"SASSetWaveformFileTypes",
"LoadImpedanceAFG",
]
11 changes: 7 additions & 4 deletions src/tm_devices/helpers/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,10 +527,13 @@ def get_visa_backend(visa_lib_path: str) -> str:
raise KeyError # noqa: TRY301
except KeyError:
found_visa = False
for visa_type in visa_backends:
for visa_implementation in visa_backends[visa_type]:
if visa_lib_path in visa_implementation:
vendor = visa_backends[visa_type][visa_implementation]["Vendor"]
for visa_type, visa_implementation_dict in visa_backends.items():
for (
visa_implementation_name,
visa_implementation_details,
) in visa_implementation_dict.items():
if visa_lib_path in visa_implementation_name:
vendor = visa_implementation_details["Vendor"]
visa_name = "NI-VISA" if "National Instruments" in vendor else f"{vendor} VISA"
found_visa = True
elif visa_lib_path.endswith("yaml") and visa_type == "sim":
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pytest-order==1.3.0 ; 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.2 ; python_version >= "3.8" and python_version < "4.0"
requests==2.32.3 ; python_version >= "3.8" and python_version < "4.0"
ruff==0.7.4 ; python_version >= "3.8" and python_version < "4.0"
ruff==0.8.0 ; python_version >= "3.8" and python_version < "4.0"
setuptools==75.3.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.6 ; python_version >= "3.8" and python_version < "4.0"
Expand Down
Loading