From 89833f0d512c8f4b8d472301f22a187d3f796f7b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 22:33:30 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black-pre-commit-mirror: 25.12.0 → 26.1.0](https://github.com/psf/black-pre-commit-mirror/compare/25.12.0...26.1.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91a87409..b48a7415 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: check-yaml - id: debug-statements - repo: https://github.com/psf/black-pre-commit-mirror - rev: 25.12.0 + rev: 26.1.0 hooks: - id: black - repo: https://github.com/asottile/pyupgrade From c5aecaa8ad0824f741f71641387134e22400452c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 22:33:52 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/examples/ex_qubitekkcc_simple.py | 1 - doc/examples/qubitekk/ex_qubitekk_mc1.py | 1 - .../abstract_instruments/__init__.py | 1 - .../abstract_instruments/comm/__init__.py | 1 - .../comm/serial_manager.py | 1 - .../signal_generator/__init__.py | 1 - src/instruments/agilent/__init__.py | 1 - src/instruments/agilent/agilent33220a.py | 1 - src/instruments/aimtti/__init__.py | 1 - src/instruments/fluke/__init__.py | 1 - src/instruments/generic_scpi/__init__.py | 1 - src/instruments/glassman/__init__.py | 1 - src/instruments/glassman/glassmanfr.py | 3 +- src/instruments/hcp/__init__.py | 1 - src/instruments/hcp/tc038.py | 1 - src/instruments/hcp/tc038d.py | 2 -- src/instruments/holzworth/__init__.py | 1 - src/instruments/hp/__init__.py | 1 - src/instruments/hp/hp3325a.py | 1 - src/instruments/hp/hp6652a.py | 1 - src/instruments/keithley/__init__.py | 1 - src/instruments/keithley/keithley485.py | 2 +- src/instruments/keithley/keithley580.py | 2 +- src/instruments/lakeshore/__init__.py | 1 - src/instruments/minghe/__init__.py | 1 + src/instruments/newport/newportesp301.py | 1 - src/instruments/ondax/__init__.py | 1 + src/instruments/oxford/__init__.py | 1 - src/instruments/pfeiffer/__init__.py | 1 - src/instruments/phasematrix/__init__.py | 1 - src/instruments/picowatt/__init__.py | 1 - src/instruments/qubitekk/__init__.py | 1 - src/instruments/rigol/__init__.py | 1 - src/instruments/srs/__init__.py | 1 - src/instruments/sunpower/__init__.py | 1 - src/instruments/tektronix/__init__.py | 1 - src/instruments/tektronix/tektds224.py | 1 - src/instruments/teledyne/__init__.py | 1 - src/instruments/thorlabs/__init__.py | 1 - src/instruments/toptica/__init__.py | 1 - src/instruments/yokogawa/__init__.py | 1 - src/instruments/yokogawa/yokogawa6370.py | 1 - tests/__init__.py | 8 ++--- tests/test_abstract_inst/test_electrometer.py | 1 - .../test_function_generator.py | 1 - tests/test_abstract_inst/test_multimeter.py | 1 - .../test_optical_spectrum_analyzer.py | 1 - tests/test_abstract_inst/test_oscilloscope.py | 1 - tests/test_abstract_inst/test_power_supply.py | 1 - .../test_signal_generator/test_channel.py | 1 - .../test_signal_generator.py | 1 - .../test_single_channel_sg.py | 1 - tests/test_comm/test_visa_communicator.py | 1 - tests/test_config.py | 36 +++++++------------ tests/test_glassman/test_glassmanfr.py | 1 - tests/test_hp/test_hp3325a.py | 1 - tests/test_hp/test_hpe3631a.py | 1 - tests/test_keithley/test_keithley485.py | 1 - tests/test_keithley/test_keithley580.py | 1 - tests/test_mettler_toledo/test_mt_sics.py | 1 - tests/test_minghe/test_minghe_mhs5200a.py | 1 - tests/test_named_struct.py | 1 - tests/test_newport/test_errors.py | 1 - tests/test_package.py | 1 - .../test_bool_property.py | 1 - .../test_property_factories/test_rproperty.py | 1 - tests/test_qubitekk/test_qubitekk_cc1.py | 1 - tests/test_qubitekk/test_qubitekk_mc1.py | 1 - tests/test_tektronix/test_tekawg2000.py | 1 - tests/test_tektronix/test_tekdpo4104.py | 1 - tests/test_tektronix/test_tekdpo70000.py | 1 - tests/test_tektronix/test_tektronix_tds224.py | 2 +- tests/test_tektronix/test_tktds5xx.py | 2 -- tests/test_test_utils.py | 1 - tests/test_thorlabs/test_abstract.py | 1 - tests/test_thorlabs/test_packets.py | 1 - tests/test_thorlabs/test_thorlabs_pm100usb.py | 1 - tests/test_util_fns.py | 1 - tests/test_yokogawa/test_yokogawa7651.py | 1 - tests/test_yokogawa/test_yokogawa_6370.py | 1 - 80 files changed, 21 insertions(+), 108 deletions(-) diff --git a/doc/examples/ex_qubitekkcc_simple.py b/doc/examples/ex_qubitekkcc_simple.py index e347aa21..a5e9dbc7 100644 --- a/doc/examples/ex_qubitekkcc_simple.py +++ b/doc/examples/ex_qubitekkcc_simple.py @@ -6,7 +6,6 @@ import instruments as ik import instruments.units as u - if __name__ == "__main__": # open connection to coincidence counter. If you are using Windows, this will be a com port. On linux, it will show # up in /dev/ttyusb diff --git a/doc/examples/qubitekk/ex_qubitekk_mc1.py b/doc/examples/qubitekk/ex_qubitekk_mc1.py index 63dd0a6f..de702ad2 100644 --- a/doc/examples/qubitekk/ex_qubitekk_mc1.py +++ b/doc/examples/qubitekk/ex_qubitekk_mc1.py @@ -5,7 +5,6 @@ from instruments.qubitekk import MC1 import instruments.units as u - if __name__ == "__main__": mc1 = MC1.open_serial(vid=1027, pid=24577, baud=9600, timeout=1) mc1.step_size = 25 * u.ms diff --git a/src/instruments/abstract_instruments/__init__.py b/src/instruments/abstract_instruments/__init__.py index 42a9591f..97d124c3 100644 --- a/src/instruments/abstract_instruments/__init__.py +++ b/src/instruments/abstract_instruments/__init__.py @@ -3,7 +3,6 @@ Module containing instrument abstract base classes and communication layers """ - from .instrument import Instrument from .electrometer import Electrometer from .function_generator import FunctionGenerator diff --git a/src/instruments/abstract_instruments/comm/__init__.py b/src/instruments/abstract_instruments/comm/__init__.py index a3a4b1a6..b1d55897 100644 --- a/src/instruments/abstract_instruments/comm/__init__.py +++ b/src/instruments/abstract_instruments/comm/__init__.py @@ -3,7 +3,6 @@ Module containing communication layers """ - from .abstract_comm import AbstractCommunicator from .file_communicator import FileCommunicator diff --git a/src/instruments/abstract_instruments/comm/serial_manager.py b/src/instruments/abstract_instruments/comm/serial_manager.py index b8b0edd1..b1f1ca15 100644 --- a/src/instruments/abstract_instruments/comm/serial_manager.py +++ b/src/instruments/abstract_instruments/comm/serial_manager.py @@ -15,7 +15,6 @@ from instruments.abstract_instruments.comm import SerialCommunicator - # GLOBALS ##################################################################### # We want to only *weakly* hold references to serial ports, to allow for them diff --git a/src/instruments/abstract_instruments/signal_generator/__init__.py b/src/instruments/abstract_instruments/signal_generator/__init__.py index b8181de0..be93a33a 100644 --- a/src/instruments/abstract_instruments/signal_generator/__init__.py +++ b/src/instruments/abstract_instruments/signal_generator/__init__.py @@ -3,7 +3,6 @@ Module containing signal generator abstract base classes """ - from .signal_generator import SignalGenerator from .single_channel_sg import SingleChannelSG from .channel import SGChannel diff --git a/src/instruments/agilent/__init__.py b/src/instruments/agilent/__init__.py index 741856d1..6562a1aa 100644 --- a/src/instruments/agilent/__init__.py +++ b/src/instruments/agilent/__init__.py @@ -3,6 +3,5 @@ Module containing Agilent instruments """ - from instruments.agilent.agilent33220a import Agilent33220a from instruments.agilent.agilent34410a import Agilent34410a diff --git a/src/instruments/agilent/agilent33220a.py b/src/instruments/agilent/agilent33220a.py index a78de6ba..88a1ea21 100644 --- a/src/instruments/agilent/agilent33220a.py +++ b/src/instruments/agilent/agilent33220a.py @@ -17,7 +17,6 @@ assume_units, ) - # CLASSES ##################################################################### diff --git a/src/instruments/aimtti/__init__.py b/src/instruments/aimtti/__init__.py index d49c2e42..1cec6ba5 100644 --- a/src/instruments/aimtti/__init__.py +++ b/src/instruments/aimtti/__init__.py @@ -3,5 +3,4 @@ Module containing Aim-TTi power supplies """ - from .aimttiel302p import AimTTiEL302P diff --git a/src/instruments/fluke/__init__.py b/src/instruments/fluke/__init__.py index 20649d60..16e39cad 100644 --- a/src/instruments/fluke/__init__.py +++ b/src/instruments/fluke/__init__.py @@ -3,5 +3,4 @@ Module containing Fluke instruments """ - from .fluke3000 import Fluke3000 diff --git a/src/instruments/generic_scpi/__init__.py b/src/instruments/generic_scpi/__init__.py index 39e4897c..1ff285a0 100644 --- a/src/instruments/generic_scpi/__init__.py +++ b/src/instruments/generic_scpi/__init__.py @@ -3,7 +3,6 @@ Module containing generic SCPI instruments """ - from .scpi_instrument import SCPIInstrument from .scpi_multimeter import SCPIMultimeter from .scpi_function_generator import SCPIFunctionGenerator diff --git a/src/instruments/glassman/__init__.py b/src/instruments/glassman/__init__.py index 05d01775..4a8f9727 100644 --- a/src/instruments/glassman/__init__.py +++ b/src/instruments/glassman/__init__.py @@ -3,5 +3,4 @@ Module containing Glassman power supplies """ - from .glassmanfr import GlassmanFR diff --git a/src/instruments/glassman/glassmanfr.py b/src/instruments/glassman/glassmanfr.py index 5de38043..e10a8b0a 100644 --- a/src/instruments/glassman/glassmanfr.py +++ b/src/instruments/glassman/glassmanfr.py @@ -29,6 +29,7 @@ An unrestricted license has been provided to the maintainers of the Instrument Kit project. """ + # IMPORTS ##################################################################### from struct import unpack @@ -385,7 +386,7 @@ def _parse_response(self, response): :rtype: `dict` """ - (voltage, current, monitors) = unpack("@3s3s3x1c2x", bytes(response, "utf-8")) + voltage, current, monitors = unpack("@3s3s3x1c2x", bytes(response, "utf-8")) try: voltage = self._parse_voltage(voltage) diff --git a/src/instruments/hcp/__init__.py b/src/instruments/hcp/__init__.py index 1ea46288..25393290 100644 --- a/src/instruments/hcp/__init__.py +++ b/src/instruments/hcp/__init__.py @@ -3,6 +3,5 @@ Module containing HC Photonics instruments """ - from .tc038 import TC038 from .tc038d import TC038D diff --git a/src/instruments/hcp/tc038.py b/src/instruments/hcp/tc038.py index 70565504..876150ac 100644 --- a/src/instruments/hcp/tc038.py +++ b/src/instruments/hcp/tc038.py @@ -3,7 +3,6 @@ Provides support for the TC038 AC crystal oven by HC Photonics. """ - # IMPORTS ##################################################################### diff --git a/src/instruments/hcp/tc038d.py b/src/instruments/hcp/tc038d.py index 9f52c219..546c72ee 100644 --- a/src/instruments/hcp/tc038d.py +++ b/src/instruments/hcp/tc038d.py @@ -3,7 +3,6 @@ Provides support for the TC038 AC crystal oven by HC Photonics. """ - # IMPORTS ##################################################################### @@ -12,7 +11,6 @@ from instruments.abstract_instruments.instrument import Instrument from instruments.util_fns import assume_units - # CLASSES ##################################################################### diff --git a/src/instruments/holzworth/__init__.py b/src/instruments/holzworth/__init__.py index 9b7f7752..c4ae273f 100644 --- a/src/instruments/holzworth/__init__.py +++ b/src/instruments/holzworth/__init__.py @@ -3,5 +3,4 @@ Module containing Holzworth instruments """ - from .holzworth_hs9000 import HS9000 diff --git a/src/instruments/hp/__init__.py b/src/instruments/hp/__init__.py index 531f3338..0732b7da 100644 --- a/src/instruments/hp/__init__.py +++ b/src/instruments/hp/__init__.py @@ -3,7 +3,6 @@ Module containing HP instruments """ - from .hp3325a import HP3325a from .hp3456a import HP3456a from .hp6624a import HP6624a diff --git a/src/instruments/hp/hp3325a.py b/src/instruments/hp/hp3325a.py index 307ceee6..fe0998f1 100644 --- a/src/instruments/hp/hp3325a.py +++ b/src/instruments/hp/hp3325a.py @@ -38,7 +38,6 @@ from instruments.units import ureg as u from instruments.util_fns import enum_property, unitful_property, bool_property - # CLASSES ##################################################################### diff --git a/src/instruments/hp/hp6652a.py b/src/instruments/hp/hp6652a.py index 9251d778..d5c2cfd1 100644 --- a/src/instruments/hp/hp6652a.py +++ b/src/instruments/hp/hp6652a.py @@ -13,7 +13,6 @@ from instruments.abstract_instruments import PowerSupply from instruments.util_fns import unitful_property, bool_property - # CLASSES ##################################################################### diff --git a/src/instruments/keithley/__init__.py b/src/instruments/keithley/__init__.py index 56f8ef37..6ba753d8 100644 --- a/src/instruments/keithley/__init__.py +++ b/src/instruments/keithley/__init__.py @@ -3,7 +3,6 @@ Module containing Keithley instruments """ - from .keithley195 import Keithley195 from .keithley485 import Keithley485 from .keithley580 import Keithley580 diff --git a/src/instruments/keithley/keithley485.py b/src/instruments/keithley/keithley485.py index 42cdce86..85b7667a 100644 --- a/src/instruments/keithley/keithley485.py +++ b/src/instruments/keithley/keithley485.py @@ -427,7 +427,7 @@ def _parse_measurement(self, measurement): :rtype: `~pint.Quantity` """ - (status, function, base, current) = unpack( + status, function, base, current = unpack( "@1c2s1c10s", bytes(measurement, "utf-8") ) diff --git a/src/instruments/keithley/keithley580.py b/src/instruments/keithley/keithley580.py index 951d4234..07eac91a 100644 --- a/src/instruments/keithley/keithley580.py +++ b/src/instruments/keithley/keithley580.py @@ -457,7 +457,7 @@ def parse_measurement(measurement): :rtype: `dict` """ - (status, polarity, drycircuit, drive, resistance) = struct.unpack( + status, polarity, drycircuit, drive, resistance = struct.unpack( "@4c11s", measurement ) diff --git a/src/instruments/lakeshore/__init__.py b/src/instruments/lakeshore/__init__.py index a7e04b16..96a9db77 100644 --- a/src/instruments/lakeshore/__init__.py +++ b/src/instruments/lakeshore/__init__.py @@ -3,7 +3,6 @@ Module containing Lakeshore instruments """ - from instruments.lakeshore.lakeshore336 import Lakeshore336 from instruments.lakeshore.lakeshore340 import Lakeshore340 from instruments.lakeshore.lakeshore370 import Lakeshore370 diff --git a/src/instruments/minghe/__init__.py b/src/instruments/minghe/__init__.py index 4c9ec953..1b90489e 100644 --- a/src/instruments/minghe/__init__.py +++ b/src/instruments/minghe/__init__.py @@ -2,4 +2,5 @@ """ Module containing MingHe instruments """ + from .mhs5200a import MHS5200 diff --git a/src/instruments/newport/newportesp301.py b/src/instruments/newport/newportesp301.py index 0aa05f5d..f083809b 100644 --- a/src/instruments/newport/newportesp301.py +++ b/src/instruments/newport/newportesp301.py @@ -19,7 +19,6 @@ from instruments.units import ureg as u from instruments.util_fns import assume_units, ProxyList - # CLASSES ##################################################################### diff --git a/src/instruments/ondax/__init__.py b/src/instruments/ondax/__init__.py index 4e232d1f..a97dfa44 100644 --- a/src/instruments/ondax/__init__.py +++ b/src/instruments/ondax/__init__.py @@ -2,4 +2,5 @@ """ Module containing Ondax Instruments """ + from .lm import LM diff --git a/src/instruments/oxford/__init__.py b/src/instruments/oxford/__init__.py index 94cbe8a6..7451162a 100644 --- a/src/instruments/oxford/__init__.py +++ b/src/instruments/oxford/__init__.py @@ -3,5 +3,4 @@ Module containing Oxford instruments """ - from .oxforditc503 import OxfordITC503 diff --git a/src/instruments/pfeiffer/__init__.py b/src/instruments/pfeiffer/__init__.py index 5bcbcda1..3ee75986 100644 --- a/src/instruments/pfeiffer/__init__.py +++ b/src/instruments/pfeiffer/__init__.py @@ -3,5 +3,4 @@ Module containing Pfeiffer instruments """ - from .tpg36x import TPG36x diff --git a/src/instruments/phasematrix/__init__.py b/src/instruments/phasematrix/__init__.py index 8417858a..4c770a81 100644 --- a/src/instruments/phasematrix/__init__.py +++ b/src/instruments/phasematrix/__init__.py @@ -3,5 +3,4 @@ Module containing Phase Matrix instruments """ - from .phasematrix_fsw0020 import PhaseMatrixFSW0020 diff --git a/src/instruments/picowatt/__init__.py b/src/instruments/picowatt/__init__.py index 28afb8b7..95cbdce0 100644 --- a/src/instruments/picowatt/__init__.py +++ b/src/instruments/picowatt/__init__.py @@ -3,5 +3,4 @@ Module containing Picowatt instruments """ - from .picowattavs47 import PicowattAVS47 diff --git a/src/instruments/qubitekk/__init__.py b/src/instruments/qubitekk/__init__.py index 107d9d94..ff176fc1 100644 --- a/src/instruments/qubitekk/__init__.py +++ b/src/instruments/qubitekk/__init__.py @@ -3,6 +3,5 @@ Module containing Qubitekk instruments """ - from .cc1 import CC1 from .mc1 import MC1 diff --git a/src/instruments/rigol/__init__.py b/src/instruments/rigol/__init__.py index 150631a2..f75deb60 100644 --- a/src/instruments/rigol/__init__.py +++ b/src/instruments/rigol/__init__.py @@ -3,5 +3,4 @@ Module containing Rigol instruments """ - from .rigolds1000 import RigolDS1000Series diff --git a/src/instruments/srs/__init__.py b/src/instruments/srs/__init__.py index dcdf1a05..b3355d60 100644 --- a/src/instruments/srs/__init__.py +++ b/src/instruments/srs/__init__.py @@ -3,7 +3,6 @@ Module containing Lakeshore instruments """ - from .srs345 import SRS345 from .srs830 import SRS830 from .srsdg645 import SRSDG645 diff --git a/src/instruments/sunpower/__init__.py b/src/instruments/sunpower/__init__.py index c18a77fe..272882fe 100644 --- a/src/instruments/sunpower/__init__.py +++ b/src/instruments/sunpower/__init__.py @@ -3,5 +3,4 @@ Module containing Sunpower instruments """ - from .cryotel_gt import CryoTelGT diff --git a/src/instruments/tektronix/__init__.py b/src/instruments/tektronix/__init__.py index 664f34fa..fcbc4c8c 100644 --- a/src/instruments/tektronix/__init__.py +++ b/src/instruments/tektronix/__init__.py @@ -3,7 +3,6 @@ Module containing Tektronix instruments """ - from .tekdpo4104 import TekDPO4104 from .tekdpo70000 import TekDPO70000 from .tekawg2000 import TekAWG2000 diff --git a/src/instruments/tektronix/tektds224.py b/src/instruments/tektronix/tektds224.py index ee2b7501..1e855dad 100644 --- a/src/instruments/tektronix/tektds224.py +++ b/src/instruments/tektronix/tektds224.py @@ -15,7 +15,6 @@ from instruments.util_fns import ProxyList from instruments.units import ureg as u - # CLASSES ##################################################################### diff --git a/src/instruments/teledyne/__init__.py b/src/instruments/teledyne/__init__.py index d7ad837d..11cc742b 100644 --- a/src/instruments/teledyne/__init__.py +++ b/src/instruments/teledyne/__init__.py @@ -3,5 +3,4 @@ Module containing Teledyne instruments """ - from .maui import MAUI diff --git a/src/instruments/thorlabs/__init__.py b/src/instruments/thorlabs/__init__.py index 62572190..9a02ee6e 100644 --- a/src/instruments/thorlabs/__init__.py +++ b/src/instruments/thorlabs/__init__.py @@ -3,7 +3,6 @@ Module containing Thorlabs instruments """ - from .thorlabsapt import ( ThorLabsAPT, APTPiezoInertiaActuator, diff --git a/src/instruments/toptica/__init__.py b/src/instruments/toptica/__init__.py index 6804dc47..069fbba6 100644 --- a/src/instruments/toptica/__init__.py +++ b/src/instruments/toptica/__init__.py @@ -3,5 +3,4 @@ Module containing Toptica instruments """ - from .topmode import TopMode diff --git a/src/instruments/yokogawa/__init__.py b/src/instruments/yokogawa/__init__.py index 9f0b4fe5..ba95cb6e 100644 --- a/src/instruments/yokogawa/__init__.py +++ b/src/instruments/yokogawa/__init__.py @@ -3,6 +3,5 @@ Module containing Yokogawa instruments """ - from .yokogawa6370 import Yokogawa6370 from .yokogawa7651 import Yokogawa7651 diff --git a/src/instruments/yokogawa/yokogawa6370.py b/src/instruments/yokogawa/yokogawa6370.py index f954808d..72a80339 100644 --- a/src/instruments/yokogawa/yokogawa6370.py +++ b/src/instruments/yokogawa/yokogawa6370.py @@ -21,7 +21,6 @@ string_property, ) - # CLASSES ##################################################################### diff --git a/tests/__init__.py b/tests/__init__.py index c2281d16..312a0f25 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -85,17 +85,13 @@ def expected_protocol(ins_class, host_to_ins, ins_to_host, sep="\n", repeat=1): yield ins_class.open_test(stdin, stdout) - assert ( - stdout.getvalue() == host_to_ins - ), """Expected: + assert stdout.getvalue() == host_to_ins, """Expected: {} Got: -{}""".format( - repr(host_to_ins), repr(stdout.getvalue()) - ) +{}""".format(repr(host_to_ins), repr(stdout.getvalue())) # current = stdin.tell() # stdin.seek(0, 2) diff --git a/tests/test_abstract_inst/test_electrometer.py b/tests/test_abstract_inst/test_electrometer.py index d51b02d3..7540ead4 100644 --- a/tests/test_abstract_inst/test_electrometer.py +++ b/tests/test_abstract_inst/test_electrometer.py @@ -11,7 +11,6 @@ import instruments as ik from tests import expected_protocol - # TESTS ###################################################################### diff --git a/tests/test_abstract_inst/test_function_generator.py b/tests/test_abstract_inst/test_function_generator.py index 109e077c..89b33eaa 100644 --- a/tests/test_abstract_inst/test_function_generator.py +++ b/tests/test_abstract_inst/test_function_generator.py @@ -12,7 +12,6 @@ import instruments as ik from tests import expected_protocol, unit_eq - # TESTS ###################################################################### # pylint: disable=missing-function-docstring,redefined-outer-name,protected-access diff --git a/tests/test_abstract_inst/test_multimeter.py b/tests/test_abstract_inst/test_multimeter.py index 161caeff..121fab70 100644 --- a/tests/test_abstract_inst/test_multimeter.py +++ b/tests/test_abstract_inst/test_multimeter.py @@ -11,7 +11,6 @@ import instruments as ik from tests import expected_protocol - # TESTS ###################################################################### diff --git a/tests/test_abstract_inst/test_optical_spectrum_analyzer.py b/tests/test_abstract_inst/test_optical_spectrum_analyzer.py index 9050e097..04f5e2e1 100644 --- a/tests/test_abstract_inst/test_optical_spectrum_analyzer.py +++ b/tests/test_abstract_inst/test_optical_spectrum_analyzer.py @@ -11,7 +11,6 @@ import instruments as ik from tests import expected_protocol - # TESTS ###################################################################### diff --git a/tests/test_abstract_inst/test_oscilloscope.py b/tests/test_abstract_inst/test_oscilloscope.py index 5a055093..60179507 100644 --- a/tests/test_abstract_inst/test_oscilloscope.py +++ b/tests/test_abstract_inst/test_oscilloscope.py @@ -11,7 +11,6 @@ import instruments as ik from tests import expected_protocol - # TESTS ###################################################################### diff --git a/tests/test_abstract_inst/test_power_supply.py b/tests/test_abstract_inst/test_power_supply.py index f23e74da..189a8ec4 100644 --- a/tests/test_abstract_inst/test_power_supply.py +++ b/tests/test_abstract_inst/test_power_supply.py @@ -11,7 +11,6 @@ import instruments as ik from tests import expected_protocol - # TESTS ###################################################################### diff --git a/tests/test_abstract_inst/test_signal_generator/test_channel.py b/tests/test_abstract_inst/test_signal_generator/test_channel.py index d348b03e..dd158616 100644 --- a/tests/test_abstract_inst/test_signal_generator/test_channel.py +++ b/tests/test_abstract_inst/test_signal_generator/test_channel.py @@ -10,7 +10,6 @@ import instruments as ik - # TESTS ###################################################################### diff --git a/tests/test_abstract_inst/test_signal_generator/test_signal_generator.py b/tests/test_abstract_inst/test_signal_generator/test_signal_generator.py index 1eea29e6..2282177d 100644 --- a/tests/test_abstract_inst/test_signal_generator/test_signal_generator.py +++ b/tests/test_abstract_inst/test_signal_generator/test_signal_generator.py @@ -11,7 +11,6 @@ import instruments as ik from tests import expected_protocol - # TESTS ###################################################################### diff --git a/tests/test_abstract_inst/test_signal_generator/test_single_channel_sg.py b/tests/test_abstract_inst/test_signal_generator/test_single_channel_sg.py index 998143a6..52d0eeb8 100644 --- a/tests/test_abstract_inst/test_signal_generator/test_single_channel_sg.py +++ b/tests/test_abstract_inst/test_signal_generator/test_single_channel_sg.py @@ -11,7 +11,6 @@ import instruments as ik from tests import expected_protocol - # TESTS ###################################################################### diff --git a/tests/test_comm/test_visa_communicator.py b/tests/test_comm/test_visa_communicator.py index 07edb661..413bfc25 100644 --- a/tests/test_comm/test_visa_communicator.py +++ b/tests/test_comm/test_visa_communicator.py @@ -12,7 +12,6 @@ from instruments.units import ureg as u from instruments.abstract_instruments.comm import VisaCommunicator - # TEST CASES ################################################################# # pylint: disable=protected-access,redefined-outer-name diff --git a/tests/test_config.py b/tests/test_config.py index aab7d718..e43b5840 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -22,13 +22,11 @@ def test_load_test_instrument(): - config_data = StringIO( - """ + config_data = StringIO(""" test: class: !!python/name:instruments.Instrument uri: test:// -""" - ) +""") insts = load_instruments(config_data) assert isinstance(insts["test"], Instrument) @@ -36,39 +34,33 @@ def test_load_test_instrument(): def test_load_test_instrument_from_file(tmp_path): """Load an instrument from a `.yml` file with filename as string.""" conf_file = tmp_path.joinpath("config.yml") - conf_file.write_text( - """ + conf_file.write_text(""" test: class: !!python/name:instruments.Instrument uri: test:// -""" - ) +""") insts = load_instruments(str(conf_file.absolute())) assert isinstance(insts["test"], Instrument) def test_load_test_instrument_subtree(): - config_data = StringIO( - """ + config_data = StringIO(""" instruments: test: class: !!python/name:instruments.Instrument uri: test:// -""" - ) +""") insts = load_instruments(config_data, conf_path="/instruments") assert isinstance(insts["test"], Instrument) def test_yaml_quantity_tag(): - yaml_data = StringIO( - """ + yaml_data = StringIO(""" a: b: !Q 37 tesla c: !Q 41.2 inches d: !Q 98 -""" - ) +""") data = yaml.load(yaml_data) assert data["a"]["b"] == u.Quantity(37, "tesla") assert data["a"]["c"] == u.Quantity(41.2, "inches") @@ -76,28 +68,24 @@ def test_yaml_quantity_tag(): def test_load_test_instrument_setattr(): - config_data = StringIO( - """ + config_data = StringIO(""" test: class: !!python/name:instruments.Instrument uri: test:// attrs: foo: !Q 111 GHz -""" - ) +""") insts = load_instruments(config_data) assert insts["test"].foo == u.Quantity(111, "GHz") def test_load_test_instrument_oserror(mocker): """Raise warning and continue in case loading test instrument fails with OSError.""" - config_data = StringIO( - """ + config_data = StringIO(""" test: class: !!python/name:instruments.Instrument uri: test:// -""" - ) +""") mocker.patch.object(Instrument, "open_from_uri", side_effect=OSError) diff --git a/tests/test_glassman/test_glassmanfr.py b/tests/test_glassman/test_glassmanfr.py index f2e7bb54..0cbf0627 100644 --- a/tests/test_glassman/test_glassmanfr.py +++ b/tests/test_glassman/test_glassmanfr.py @@ -11,7 +11,6 @@ from tests import expected_protocol from instruments.units import ureg as u - # TESTS ###################################################################### # pylint: disable=protected-access diff --git a/tests/test_hp/test_hp3325a.py b/tests/test_hp/test_hp3325a.py index 9db0f11f..b112b469 100644 --- a/tests/test_hp/test_hp3325a.py +++ b/tests/test_hp/test_hp3325a.py @@ -12,7 +12,6 @@ import instruments as ik from tests import expected_protocol - # TESTS ####################################################################### # pylint: disable=protected-access diff --git a/tests/test_hp/test_hpe3631a.py b/tests/test_hp/test_hpe3631a.py index c2466357..b4478baf 100644 --- a/tests/test_hp/test_hpe3631a.py +++ b/tests/test_hp/test_hpe3631a.py @@ -14,7 +14,6 @@ import instruments as ik from tests import expected_protocol - # TESTS ####################################################################### diff --git a/tests/test_keithley/test_keithley485.py b/tests/test_keithley/test_keithley485.py index 69d3bfdd..005535bb 100644 --- a/tests/test_keithley/test_keithley485.py +++ b/tests/test_keithley/test_keithley485.py @@ -12,7 +12,6 @@ import instruments as ik from tests import expected_protocol - # TESTS ###################################################################### # pylint: disable=protected-access diff --git a/tests/test_keithley/test_keithley580.py b/tests/test_keithley/test_keithley580.py index b0302dff..f3028ac9 100644 --- a/tests/test_keithley/test_keithley580.py +++ b/tests/test_keithley/test_keithley580.py @@ -19,7 +19,6 @@ from tests import expected_protocol from instruments.units import ureg as u - # TESTS ###################################################################### diff --git a/tests/test_mettler_toledo/test_mt_sics.py b/tests/test_mettler_toledo/test_mt_sics.py index 0675af2a..a3fcf1ee 100644 --- a/tests/test_mettler_toledo/test_mt_sics.py +++ b/tests/test_mettler_toledo/test_mt_sics.py @@ -11,7 +11,6 @@ from instruments.units import ureg as u from tests import expected_protocol - # TESTS ####################################################################### diff --git a/tests/test_minghe/test_minghe_mhs5200a.py b/tests/test_minghe/test_minghe_mhs5200a.py index a86477c5..26f2d00c 100644 --- a/tests/test_minghe/test_minghe_mhs5200a.py +++ b/tests/test_minghe/test_minghe_mhs5200a.py @@ -12,7 +12,6 @@ import instruments as ik from tests import expected_protocol - # TESTS ###################################################################### diff --git a/tests/test_named_struct.py b/tests/test_named_struct.py index 542a9690..aef05a4b 100644 --- a/tests/test_named_struct.py +++ b/tests/test_named_struct.py @@ -13,7 +13,6 @@ from instruments.named_struct import Field, StringField, Padding, NamedStruct - # TESTS ###################################################################### # We disable pylint warnings that are not as applicable for unit tests. diff --git a/tests/test_newport/test_errors.py b/tests/test_newport/test_errors.py index 1e3c8cbc..f6ddc40d 100644 --- a/tests/test_newport/test_errors.py +++ b/tests/test_newport/test_errors.py @@ -10,7 +10,6 @@ from instruments.newport.errors import NewportError - # TESTS ###################################################################### diff --git a/tests/test_package.py b/tests/test_package.py index 6388908f..450d067f 100644 --- a/tests/test_package.py +++ b/tests/test_package.py @@ -6,7 +6,6 @@ import instruments._version as ik_version_file - # TEST CASES ################################################################# diff --git a/tests/test_property_factories/test_bool_property.py b/tests/test_property_factories/test_bool_property.py index a8cf266d..20357a35 100644 --- a/tests/test_property_factories/test_bool_property.py +++ b/tests/test_property_factories/test_bool_property.py @@ -11,7 +11,6 @@ from instruments.util_fns import bool_property from . import MockInstrument - # TEST CASES ################################################################# # pylint: disable=missing-docstring diff --git a/tests/test_property_factories/test_rproperty.py b/tests/test_property_factories/test_rproperty.py index 8391fca6..8b8de12c 100644 --- a/tests/test_property_factories/test_rproperty.py +++ b/tests/test_property_factories/test_rproperty.py @@ -11,7 +11,6 @@ from instruments.util_fns import rproperty from . import MockInstrument - # TEST CASES ################################################################# # pylint: disable=missing-docstring diff --git a/tests/test_qubitekk/test_qubitekk_cc1.py b/tests/test_qubitekk/test_qubitekk_cc1.py index 0156b2f9..290c06a2 100644 --- a/tests/test_qubitekk/test_qubitekk_cc1.py +++ b/tests/test_qubitekk/test_qubitekk_cc1.py @@ -12,7 +12,6 @@ import instruments as ik from tests import expected_protocol, unit_eq - # TESTS ###################################################################### diff --git a/tests/test_qubitekk/test_qubitekk_mc1.py b/tests/test_qubitekk/test_qubitekk_mc1.py index 62f131b9f..7d13dfef 100644 --- a/tests/test_qubitekk/test_qubitekk_mc1.py +++ b/tests/test_qubitekk/test_qubitekk_mc1.py @@ -12,7 +12,6 @@ import instruments as ik from tests import expected_protocol - # TESTS ###################################################################### diff --git a/tests/test_tektronix/test_tekawg2000.py b/tests/test_tektronix/test_tekawg2000.py index aae22b4f..9dd083ca 100644 --- a/tests/test_tektronix/test_tekawg2000.py +++ b/tests/test_tektronix/test_tekawg2000.py @@ -16,7 +16,6 @@ from tests import expected_protocol, make_name_test from instruments.units import ureg as u - # TESTS ####################################################################### # pylint: disable=protected-access diff --git a/tests/test_tektronix/test_tekdpo4104.py b/tests/test_tektronix/test_tekdpo4104.py index e8256250..8e82a093 100644 --- a/tests/test_tektronix/test_tekdpo4104.py +++ b/tests/test_tektronix/test_tekdpo4104.py @@ -22,7 +22,6 @@ make_name_test, ) - # TESTS ####################################################################### # pylint: disable=protected-access diff --git a/tests/test_tektronix/test_tekdpo70000.py b/tests/test_tektronix/test_tekdpo70000.py index 4175995b..058c50cb 100644 --- a/tests/test_tektronix/test_tekdpo70000.py +++ b/tests/test_tektronix/test_tekdpo70000.py @@ -24,7 +24,6 @@ ) from instruments.units import ureg as u - # TESTS ####################################################################### # pylint: disable=too-many-lines,protected-access diff --git a/tests/test_tektronix/test_tektronix_tds224.py b/tests/test_tektronix/test_tektronix_tds224.py index 3337115f..6735ffaf 100644 --- a/tests/test_tektronix/test_tektronix_tds224.py +++ b/tests/test_tektronix/test_tektronix_tds224.py @@ -150,7 +150,7 @@ def test_tektds224_data_source_read_waveform(): data = tuple(range(5)) if numpy: data = numpy.array([0, 1, 2, 3, 4]) - (x, y) = tek.channel[1].read_waveform() + x, y = tek.channel[1].read_waveform() iterable_eq(x, data) iterable_eq(y, data) diff --git a/tests/test_tektronix/test_tktds5xx.py b/tests/test_tektronix/test_tktds5xx.py index 95ea6b09..6d7897cf 100644 --- a/tests/test_tektronix/test_tktds5xx.py +++ b/tests/test_tektronix/test_tktds5xx.py @@ -3,7 +3,6 @@ Tests for the Tektronix TDS 5xx series oscilloscope. """ - # IMPORTS ##################################################################### @@ -26,7 +25,6 @@ make_name_test, ) - # TESTS ####################################################################### diff --git a/tests/test_test_utils.py b/tests/test_test_utils.py index dcaf2019..7f2c9944 100644 --- a/tests/test_test_utils.py +++ b/tests/test_test_utils.py @@ -12,7 +12,6 @@ from tests import iterable_eq from instruments.units import ureg as u - # TESTS ####################################################################### diff --git a/tests/test_thorlabs/test_abstract.py b/tests/test_thorlabs/test_abstract.py index d6c218aa..adbbb05b 100644 --- a/tests/test_thorlabs/test_abstract.py +++ b/tests/test_thorlabs/test_abstract.py @@ -15,7 +15,6 @@ from instruments.thorlabs import _packets from tests import expected_protocol - # TESTS ###################################################################### diff --git a/tests/test_thorlabs/test_packets.py b/tests/test_thorlabs/test_packets.py index 6a38d584..84a2132a 100644 --- a/tests/test_thorlabs/test_packets.py +++ b/tests/test_thorlabs/test_packets.py @@ -12,7 +12,6 @@ from instruments.thorlabs import _packets - # TESTS ###################################################################### diff --git a/tests/test_thorlabs/test_thorlabs_pm100usb.py b/tests/test_thorlabs/test_thorlabs_pm100usb.py index 13991ff8..e5a27ae1 100644 --- a/tests/test_thorlabs/test_thorlabs_pm100usb.py +++ b/tests/test_thorlabs/test_thorlabs_pm100usb.py @@ -15,7 +15,6 @@ import instruments as ik from tests import expected_protocol - # TESTS ###################################################################### diff --git a/tests/test_util_fns.py b/tests/test_util_fns.py index 1d245763..a38fb040 100644 --- a/tests/test_util_fns.py +++ b/tests/test_util_fns.py @@ -25,7 +25,6 @@ from tests import unit_eq - # FIXTURES ################################################################### diff --git a/tests/test_yokogawa/test_yokogawa7651.py b/tests/test_yokogawa/test_yokogawa7651.py index 1c10e619..1f6b7099 100644 --- a/tests/test_yokogawa/test_yokogawa7651.py +++ b/tests/test_yokogawa/test_yokogawa7651.py @@ -12,7 +12,6 @@ from instruments.units import ureg as u from tests import expected_protocol - # TESTS ####################################################################### # pylint: disable=protected-access diff --git a/tests/test_yokogawa/test_yokogawa_6370.py b/tests/test_yokogawa/test_yokogawa_6370.py index fabf33a2..ed492fbe 100644 --- a/tests/test_yokogawa/test_yokogawa_6370.py +++ b/tests/test_yokogawa/test_yokogawa_6370.py @@ -23,7 +23,6 @@ from instruments.units import ureg as u from .. import mock - # TESTS #######################################################################