diff --git a/src/cal_tools/agipdlib.py b/src/cal_tools/agipdlib.py index c50a1f19cb8ecfd3719ed05deddbd63a1ba7614e..6c2142442f36ab3fec86f97888fec7bc11bd3166 100644 --- a/src/cal_tools/agipdlib.py +++ b/src/cal_tools/agipdlib.py @@ -7,6 +7,9 @@ from typing import Any, Dict, Optional, Tuple import h5py import numpy as np import sharedmem +from iCalibrationDB import Conditions, Constants + +from cal_tools import agipdalgs as calgs from cal_tools.agipdutils import ( assemble_constant_dict, baseline_correct_via_noise, @@ -19,9 +22,6 @@ from cal_tools.agipdutils import ( ) from cal_tools.enums import AgipdGainMode, BadPixels, SnowResolution from cal_tools.tools import get_constant_from_db_and_time -from iCalibrationDB import Conditions, Constants - -from cal_tools import agipdalgs as calgs def get_num_cells(fname, loc, module): diff --git a/src/cal_tools/agipdutils.py b/src/cal_tools/agipdutils.py index 44cac4c87b1a0ffc8c8ba4628e38d1f68056672e..8cf5b4f375d36437f9ccd4f1332d31f5a52fdd9a 100644 --- a/src/cal_tools/agipdutils.py +++ b/src/cal_tools/agipdutils.py @@ -2,11 +2,12 @@ import copy from typing import Tuple import numpy as np -from cal_tools.enums import AgipdGainMode, BadPixels, SnowResolution from scipy.signal import cwt, find_peaks_cwt, ricker from sklearn.mixture import GaussianMixture from sklearn.preprocessing import StandardScaler +from cal_tools.enums import AgipdGainMode, BadPixels, SnowResolution + def assemble_constant_dict( corr_bools, diff --git a/src/cal_tools/agipdutils_ff.py b/src/cal_tools/agipdutils_ff.py index c96093ddf15c71368f575eb2631a45a4dd63313d..08923b4d464c410200035393616b0fc5d8e7e532 100644 --- a/src/cal_tools/agipdutils_ff.py +++ b/src/cal_tools/agipdutils_ff.py @@ -1,9 +1,10 @@ from typing import Any, Dict, List, Optional, Tuple import numpy as np -from cal_tools.enums import BadPixelsFF from iminuit import Minuit +from cal_tools.enums import BadPixelsFF + def any_in(mask: np.ndarray, bits: int) -> bool: return mask.astype(np.uint) & bits > 0 diff --git a/src/cal_tools/lpdlib.py b/src/cal_tools/lpdlib.py index fd0d5132f78eded0210b0df32fca7244fc85a2df..217c769fcc6faef919697b2b671a1c9e3a65c488 100644 --- a/src/cal_tools/lpdlib.py +++ b/src/cal_tools/lpdlib.py @@ -3,9 +3,10 @@ from typing import Optional, Tuple import h5py import numpy as np +from iCalibrationDB import Conditions, Constants, Detectors + from cal_tools.enums import BadPixels from cal_tools.tools import get_constant_from_db, get_constant_from_db_and_time -from iCalibrationDB import Conditions, Constants, Detectors class LpdCorrections: diff --git a/tests/test_agipdutils_ff.py b/tests/test_agipdutils_ff.py index 579c905f662bf7c690874e5b20297e7e9d485db8..19947eb35494366794801bf288526bda39bf42cf 100644 --- a/tests/test_agipdutils_ff.py +++ b/tests/test_agipdutils_ff.py @@ -1,4 +1,5 @@ import numpy as np + from cal_tools.agipdutils_ff import get_mask, set_par_limits diff --git a/tests/test_cal_tools.py b/tests/test_cal_tools.py index 62567e43832923aa1d2b39b5491b56106f4c40ec..a6afb6d35e26f8bfacce92ed559efd2e833ded1c 100644 --- a/tests/test_cal_tools.py +++ b/tests/test_cal_tools.py @@ -2,14 +2,11 @@ from datetime import datetime from pathlib import Path import pytest +from iCalibrationDB import Conditions, Constants + from cal_tools.agipdlib import AgipdCorrections from cal_tools.plotting import show_processed_modules -from cal_tools.tools import ( - get_dir_creation_date, - get_pdu_from_db, - module_index_to_qm, -) -from iCalibrationDB import Conditions, Constants +from cal_tools.tools import get_dir_creation_date, get_pdu_from_db, module_index_to_qm def test_show_processed_modules(): diff --git a/tests/test_webservice.py b/tests/test_webservice.py index 072c38bebaddff38772096e2ad849614a39659ab..4da6d42528e5012946a2d78be94dc1be43fb2469 100644 --- a/tests/test_webservice.py +++ b/tests/test_webservice.py @@ -8,7 +8,11 @@ from testpath import MockCommand sys.path.insert(0, Path(__file__).parent / 'webservice') import webservice # noqa: import not at top of file from webservice.webservice import ( # noqa: import not at top of file - check_files, merge, parse_config, run_action, wait_on_transfer + check_files, + merge, + parse_config, + run_action, + wait_on_transfer, )