diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 877f1537..0c8e71b8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,3 +7,4 @@ repos: rev: 24.4.2 hooks: - id: black + diff --git a/src/fixate/config/__init__.py b/src/fixate/config/__init__.py index 0f1c38dc..63f53fd3 100644 --- a/src/fixate/config/__init__.py +++ b/src/fixate/config/__init__.py @@ -4,6 +4,7 @@ Drivers are hard coded into the config to prevent issues arising from auto discovery Must ensure driver imports are infallible to prevent program crash on start """ + from fixate.config.helper import ( load_dict_config, load_yaml_config, diff --git a/src/fixate/core/checks.py b/src/fixate/core/checks.py index a4eb09a7..fef2f852 100644 --- a/src/fixate/core/checks.py +++ b/src/fixate/core/checks.py @@ -2,6 +2,7 @@ This module is used to allow for tests to test values against criteria. It should implement necessary logging functions and report success or failure. """ + from dataclasses import dataclass, field from typing import Any, Callable, Iterable, Optional import logging diff --git a/src/fixate/core/ui.py b/src/fixate/core/ui.py index 602f38cc..53729dd0 100644 --- a/src/fixate/core/ui.py +++ b/src/fixate/core/ui.py @@ -1,6 +1,7 @@ """ This module details user input api """ + import time from queue import Queue, Empty from pubsub import pub diff --git a/src/fixate/drivers/daq/daqmx.py b/src/fixate/drivers/daq/daqmx.py index ade5d720..cf9b59ef 100644 --- a/src/fixate/drivers/daq/daqmx.py +++ b/src/fixate/drivers/daq/daqmx.py @@ -15,6 +15,7 @@ C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h """ + from collections import namedtuple from fixate.core.common import ExcThread from queue import Queue, Empty diff --git a/src/fixate/drivers/dmm/__init__.py b/src/fixate/drivers/dmm/__init__.py index fcf83cfa..2465948e 100644 --- a/src/fixate/drivers/dmm/__init__.py +++ b/src/fixate/drivers/dmm/__init__.py @@ -7,6 +7,7 @@ dmm.measure(*mode, **mode_params) dmm.reset() """ + import pyvisa import fixate.drivers diff --git a/src/fixate/drivers/funcgen/__init__.py b/src/fixate/drivers/funcgen/__init__.py index 8e874683..de5d9c5f 100644 --- a/src/fixate/drivers/funcgen/__init__.py +++ b/src/fixate/drivers/funcgen/__init__.py @@ -22,6 +22,7 @@ output_ch3 output_ch4 """ + import pyvisa import fixate.drivers diff --git a/src/fixate/drivers/handlers.py b/src/fixate/drivers/handlers.py index 0cc64021..df6faf20 100644 --- a/src/fixate/drivers/handlers.py +++ b/src/fixate/drivers/handlers.py @@ -2,6 +2,7 @@ This module implements concrete AddressHandler type, that can be used to implement IO for the fixate.core.switching module. """ + from __future__ import annotations from typing import Sequence, Optional diff --git a/src/fixate/drivers/lcr/__init__.py b/src/fixate/drivers/lcr/__init__.py index f33328a2..e3a81381 100644 --- a/src/fixate/drivers/lcr/__init__.py +++ b/src/fixate/drivers/lcr/__init__.py @@ -5,6 +5,7 @@ Functions are dictated by the metaclass in helper.py """ + import pyvisa import fixate.drivers diff --git a/src/fixate/drivers/pps/bk_178x.py b/src/fixate/drivers/pps/bk_178x.py index a81100d7..26b2a782 100644 --- a/src/fixate/drivers/pps/bk_178x.py +++ b/src/fixate/drivers/pps/bk_178x.py @@ -146,9 +146,9 @@ def _packet_encode(self, command, *data_tuples): packet[2] = command packet_index = 3 for data, num_bytes in data_tuples: - packet[ - packet_index : packet_index + num_bytes - ] = self._little_endian_encode(data)[0:num_bytes] + packet[packet_index : packet_index + num_bytes] = ( + self._little_endian_encode(data)[0:num_bytes] + ) packet_index += num_bytes if packet_index >= self.PACKET_LENGTH: raise ValueError("Too many bytes to pack into packet") diff --git a/src/fixate/examples/function_generator.py b/src/fixate/examples/function_generator.py index b660f047..a57e24de 100644 --- a/src/fixate/examples/function_generator.py +++ b/src/fixate/examples/function_generator.py @@ -1,6 +1,7 @@ """ Examples on how to use the function generator driver """ + import time from fixate.core.common import TestClass, TestList diff --git a/src/fixate/examples/jig_driver.py b/src/fixate/examples/jig_driver.py index 6d56cdf6..977318a5 100644 --- a/src/fixate/examples/jig_driver.py +++ b/src/fixate/examples/jig_driver.py @@ -2,6 +2,7 @@ This file is just a test playground that shows how the update jig classes will fit together. """ + from __future__ import annotations from dataclasses import dataclass, field from fixate import ( diff --git a/src/fixate/examples/programmable_power_supply.py b/src/fixate/examples/programmable_power_supply.py index da112be2..7f263e9d 100644 --- a/src/fixate/examples/programmable_power_supply.py +++ b/src/fixate/examples/programmable_power_supply.py @@ -1,6 +1,7 @@ """ Examples on how to use the programmable power supply driver works """ + import time from fixate.core.common import TestClass, TestList diff --git a/src/fixate/examples/test_script.py b/src/fixate/examples/test_script.py index 185283c4..330b0339 100644 --- a/src/fixate/examples/test_script.py +++ b/src/fixate/examples/test_script.py @@ -1,6 +1,7 @@ """ This is a test script that shows basic use case for the fixate library """ + from fixate.core.common import TestClass, TestList from fixate.core.checks import * from fixate.core.ui import * diff --git a/src/fixate/reporting/csv.py b/src/fixate/reporting/csv.py index 2b4108d6..3e332f35 100644 --- a/src/fixate/reporting/csv.py +++ b/src/fixate/reporting/csv.py @@ -84,6 +84,7 @@ Test End