From aba20c219c5849e7c9d434bac77dddc867097d5c Mon Sep 17 00:00:00 2001 From: Christian Bespin Date: Mon, 16 Dec 2024 16:04:40 +0100 Subject: [PATCH] Sort imports and apply black on everything --- aidatlu/TLUPyProducer.py | 7 ++++--- aidatlu/aidatlu_run.py | 1 - aidatlu/hardware/clock_controller.py | 2 +- aidatlu/hardware/dac_controller.py | 2 +- aidatlu/hardware/i2c.py | 1 + aidatlu/hardware/trigger_controller.py | 2 +- aidatlu/logger.py | 1 + aidatlu/main/config_parser.py | 3 ++- aidatlu/main/tlu.py | 3 ++- aidatlu/online_monitor/tlu_receiver.py | 5 ++--- aidatlu/test/hardware_test.py | 17 +++++++++-------- aidatlu/test/software_test.py | 4 ++-- docs/source/conf.py | 2 +- setup.py | 3 +-- 14 files changed, 28 insertions(+), 25 deletions(-) diff --git a/aidatlu/TLUPyProducer.py b/aidatlu/TLUPyProducer.py index e99211d..227213a 100644 --- a/aidatlu/TLUPyProducer.py +++ b/aidatlu/TLUPyProducer.py @@ -1,10 +1,11 @@ #! /usr/bin/env python3 # load binary lib/pyeudaq.so -import pyeudaq -from pyeudaq import EUDAQ_INFO, EUDAQ_ERROR import time -from main.tlu import AidaTLU + +import pyeudaq import uhal +from main.tlu import AidaTLU +from pyeudaq import EUDAQ_ERROR, EUDAQ_INFO """ Example Producer from EUDAQ diff --git a/aidatlu/aidatlu_run.py b/aidatlu/aidatlu_run.py index bcd679d..c2e1eaf 100644 --- a/aidatlu/aidatlu_run.py +++ b/aidatlu/aidatlu_run.py @@ -1,5 +1,4 @@ import uhal - from main.tlu import AidaTLU diff --git a/aidatlu/hardware/clock_controller.py b/aidatlu/hardware/clock_controller.py index 1ec388f..add7e5d 100644 --- a/aidatlu/hardware/clock_controller.py +++ b/aidatlu/hardware/clock_controller.py @@ -1,6 +1,6 @@ +from aidatlu import logger from aidatlu.hardware.i2c import I2CCore from aidatlu.hardware.ioexpander_controller import IOControl -from aidatlu import logger class ClockControl: diff --git a/aidatlu/hardware/dac_controller.py b/aidatlu/hardware/dac_controller.py index e66d8e2..227ce82 100644 --- a/aidatlu/hardware/dac_controller.py +++ b/aidatlu/hardware/dac_controller.py @@ -1,5 +1,5 @@ -from aidatlu.hardware.i2c import I2CCore from aidatlu import logger +from aidatlu.hardware.i2c import I2CCore class DacControl: diff --git a/aidatlu/hardware/i2c.py b/aidatlu/hardware/i2c.py index 2ff39de..5ddff28 100644 --- a/aidatlu/hardware/i2c.py +++ b/aidatlu/hardware/i2c.py @@ -1,5 +1,6 @@ import time from math import ceil + from aidatlu import logger i2c_addr = { diff --git a/aidatlu/hardware/trigger_controller.py b/aidatlu/hardware/trigger_controller.py index 39a0488..bf024dd 100644 --- a/aidatlu/hardware/trigger_controller.py +++ b/aidatlu/hardware/trigger_controller.py @@ -1,6 +1,6 @@ +from aidatlu import logger from aidatlu.hardware.i2c import I2CCore from aidatlu.hardware.utils import _pack_bits -from aidatlu import logger class TriggerLogic: diff --git a/aidatlu/logger.py b/aidatlu/logger.py index b26ea41..60f40f1 100644 --- a/aidatlu/logger.py +++ b/aidatlu/logger.py @@ -1,4 +1,5 @@ import logging + import coloredlogs FORMAT = "%(asctime)s [%(name)-18s] - %(levelname)-7s %(message)s" diff --git a/aidatlu/main/config_parser.py b/aidatlu/main/config_parser.py index d96c849..d405e51 100644 --- a/aidatlu/main/config_parser.py +++ b/aidatlu/main/config_parser.py @@ -1,8 +1,9 @@ import yaml + from aidatlu import logger -class TLUConfigure(): +class TLUConfigure: def __init__(self, TLU, io_control, config_path) -> None: self.log = logger.setup_main_logger(__class__.__name__) diff --git a/aidatlu/main/tlu.py b/aidatlu/main/tlu.py index 82b0199..4b84bdf 100644 --- a/aidatlu/main/tlu.py +++ b/aidatlu/main/tlu.py @@ -8,6 +8,7 @@ import tables as tb import uhal import zmq + from aidatlu import logger from aidatlu.hardware.clock_controller import ClockControl from aidatlu.hardware.dac_controller import DacControl @@ -19,7 +20,7 @@ from aidatlu.main.data_parser import DataParser -class AidaTLU(): +class AidaTLU: def __init__(self, hw, config_path, clock_config_path) -> None: self.log = logger.setup_main_logger(__class__.__name__) diff --git a/aidatlu/online_monitor/tlu_receiver.py b/aidatlu/online_monitor/tlu_receiver.py index 929e54f..6d7f0c3 100644 --- a/aidatlu/online_monitor/tlu_receiver.py +++ b/aidatlu/online_monitor/tlu_receiver.py @@ -1,9 +1,8 @@ import pyqtgraph as pg -from PyQt5 import QtWidgets -from pyqtgraph.dockarea import Dock, DockArea - from online_monitor.receiver.receiver import Receiver from online_monitor.utils import utils +from PyQt5 import QtWidgets +from pyqtgraph.dockarea import Dock, DockArea class AIDATLUReciever(Receiver): diff --git a/aidatlu/test/hardware_test.py b/aidatlu/test/hardware_test.py index f0015be..74b8fe4 100644 --- a/aidatlu/test/hardware_test.py +++ b/aidatlu/test/hardware_test.py @@ -1,15 +1,16 @@ -from aidatlu.main.tlu import AidaTLU -from aidatlu.hardware.i2c import I2CCore -from aidatlu.hardware.ioexpander_controller import IOControl -from aidatlu.hardware.dac_controller import DacControl +import time + +import numpy as np +import uhal + from aidatlu.hardware.clock_controller import ClockControl +from aidatlu.hardware.dac_controller import DacControl from aidatlu.hardware.dut_controller import DUTLogic +from aidatlu.hardware.i2c import I2CCore +from aidatlu.hardware.ioexpander_controller import IOControl from aidatlu.hardware.trigger_controller import TriggerLogic from aidatlu.main.config_parser import TLUConfigure - -import uhal -import time -import numpy as np +from aidatlu.main.tlu import AidaTLU class Test_IOCControl: diff --git a/aidatlu/test/software_test.py b/aidatlu/test/software_test.py index 896d963..88459e1 100644 --- a/aidatlu/test/software_test.py +++ b/aidatlu/test/software_test.py @@ -2,6 +2,7 @@ import numpy as np import tables as tb + from aidatlu.main.config_parser import TLUConfigure from aidatlu.main.data_parser import DataParser @@ -9,8 +10,7 @@ def test_interpretation(): - """Test data interpretation and compare to reference file - """ + """Test data interpretation and compare to reference file""" data_parser = DataParser() data_parser.interpret_data( diff --git a/docs/source/conf.py b/docs/source/conf.py index 8f0001a..7765bf9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -15,8 +15,8 @@ author = "Rasmus Partzsch" release = version -import sys import os +import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the diff --git a/setup.py b/setup.py index b14fb3a..9116599 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ -from setuptools import setup -from setuptools import find_packages +from setuptools import find_packages, setup author = "Christian Bespin, Rasmus Partzsch" author_email = "bespin@physik.uni-bonn.de, rasmus.partzsch@uni-bonn.de"