diff --git a/doc/examples/piv_as_real/job_piv.py b/doc/examples/piv_as_real/job_piv.py index 9609d51f..f190932d 100755 --- a/doc/examples/piv_as_real/job_piv.py +++ b/doc/examples/piv_as_real/job_piv.py @@ -14,6 +14,7 @@ """ import params_piv + from fluidimage.topologies.piv import TopologyPIV diff --git a/doc/examples/piv_as_real/job_pre.py b/doc/examples/piv_as_real/job_pre.py index 992beadd..51b82701 100755 --- a/doc/examples/piv_as_real/job_pre.py +++ b/doc/examples/piv_as_real/job_pre.py @@ -18,6 +18,7 @@ """ import params_pre + from fluidimage.topologies.preproc import TopologyPreproc try: diff --git a/doc/examples/piv_as_real/params_pre.py b/doc/examples/piv_as_real/params_pre.py index 59c64895..1825d983 100644 --- a/doc/examples/piv_as_real/params_pre.py +++ b/doc/examples/piv_as_real/params_pre.py @@ -21,9 +21,10 @@ from copy import deepcopy from glob import glob -from fluidimage.topologies.preproc import TopologyPreproc from params_piv import get_path +from fluidimage.topologies.preproc import TopologyPreproc + def make_params_pre(iexp, savinghow="recompute", postfix_out="pre"): path = get_path(iexp) diff --git a/doc/examples/piv_as_real/try_piv.py b/doc/examples/piv_as_real/try_piv.py index 5e489b41..11938895 100644 --- a/doc/examples/piv_as_real/try_piv.py +++ b/doc/examples/piv_as_real/try_piv.py @@ -14,6 +14,7 @@ """ import params_piv + from fluidimage import SeriesOfArrays from fluidimage.works.piv import WorkPIV diff --git a/doc/examples/pivchallenge/bench_piv_2005C.py b/doc/examples/pivchallenge/bench_piv_2005C.py index 4d701560..89db878d 100644 --- a/doc/examples/pivchallenge/bench_piv_2005C.py +++ b/doc/examples/pivchallenge/bench_piv_2005C.py @@ -2,9 +2,10 @@ import os import pstats -from fluidimage.topologies.piv import TopologyPIV from path_images import get_path +from fluidimage.topologies.piv import TopologyPIV + path = os.path.join(get_path("2005C"), "c*.bmp") params = TopologyPIV.create_default_params() diff --git a/doc/examples/pivchallenge/piv_2001A_topology.py b/doc/examples/pivchallenge/piv_2001A_topology.py index 3f74256d..c8c4a704 100644 --- a/doc/examples/pivchallenge/piv_2001A_topology.py +++ b/doc/examples/pivchallenge/piv_2001A_topology.py @@ -1,8 +1,9 @@ import os -from fluidimage.topologies.piv import TopologyPIV from path_images import get_path +from fluidimage.topologies.piv import TopologyPIV + params = TopologyPIV.create_default_params() path = os.path.join(get_path("2001A"), "A*") diff --git a/doc/examples/pivchallenge/piv_2001A_work.py b/doc/examples/pivchallenge/piv_2001A_work.py index 8611b755..792a1ead 100644 --- a/doc/examples/pivchallenge/piv_2001A_work.py +++ b/doc/examples/pivchallenge/piv_2001A_work.py @@ -1,8 +1,9 @@ import os +from path_images import get_path + from fluidimage import SeriesOfArrays from fluidimage.works.piv import WorkPIV -from path_images import get_path params = WorkPIV.create_default_params() diff --git a/doc/examples/pivchallenge/piv_2005C_topology.py b/doc/examples/pivchallenge/piv_2005C_topology.py index 5ee2b463..16a8b6e1 100644 --- a/doc/examples/pivchallenge/piv_2005C_topology.py +++ b/doc/examples/pivchallenge/piv_2005C_topology.py @@ -1,8 +1,9 @@ import os -from fluidimage.topologies.piv import TopologyPIV from path_images import get_path +from fluidimage.topologies.piv import TopologyPIV + path = os.path.join(get_path("2005C"), "c*.bmp") params = TopologyPIV.create_default_params() diff --git a/doc/examples/pivchallenge/piv_2005C_work.py b/doc/examples/pivchallenge/piv_2005C_work.py index c1606190..dd16db00 100644 --- a/doc/examples/pivchallenge/piv_2005C_work.py +++ b/doc/examples/pivchallenge/piv_2005C_work.py @@ -1,9 +1,10 @@ import os from time import time +from path_images import get_path + from fluidimage import SeriesOfArrays from fluidimage.works.piv import WorkPIV -from path_images import get_path path = os.path.join(get_path("2005C"), "c*.bmp") diff --git a/pyproject.toml b/pyproject.toml index 2933b2e1..ce4108dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -110,7 +110,7 @@ dev = [ [tool.pdm.scripts] black = "black src doc" -isort = "isort -rc --atomic -tc src bench doc/examples" +isort = "isort --atomic --tc src bench doc/examples" black_check = "black --check src doc" lint = {shell="pylint -rn --rcfile=pylintrc --jobs=$(nproc) src doc --exit-zero"} validate_code = {composite = ["black_check", "lint"]} diff --git a/src/fluidimage/__init__.py b/src/fluidimage/__init__.py index 8f4c529f..888996ec 100644 --- a/src/fluidimage/__init__.py +++ b/src/fluidimage/__init__.py @@ -20,14 +20,14 @@ """ import sys -from subprocess import getoutput from pathlib import Path +from subprocess import getoutput import numpy as np - from fluiddyn.util import create_object_from_file, get_memory_usage from fluiddyn.util.paramcontainer import ParamContainer from fluiddyn.util.serieofarrays import SerieOfArraysFromFiles, SeriesOfArrays + from fluidimage.topologies.log import LogTopology from ._version import __version__ diff --git a/src/fluidimage/calcul/correl.py b/src/fluidimage/calcul/correl.py index 0bfca3f6..77d0807e 100644 --- a/src/fluidimage/calcul/correl.py +++ b/src/fluidimage/calcul/correl.py @@ -50,7 +50,6 @@ from numpy.fft import fft2, ifft2 from scipy.ndimage import correlate from scipy.signal import correlate2d - from transonic import boost from .correl_pycuda import correl_pycuda diff --git a/src/fluidimage/calcul/correl_pycuda.py b/src/fluidimage/calcul/correl_pycuda.py index 812b8cdf..cafc5970 100644 --- a/src/fluidimage/calcul/correl_pycuda.py +++ b/src/fluidimage/calcul/correl_pycuda.py @@ -10,8 +10,8 @@ try: import pycuda.autoinit import pycuda.compiler - import pycuda.gpuarray import pycuda.driver + import pycuda.gpuarray except (ImportError, pycuda._driver.RuntimeError): pass diff --git a/src/fluidimage/calcul/interpolate/_bench_tps_matrix.py b/src/fluidimage/calcul/interpolate/_bench_tps_matrix.py index 8e0d2176..b857b6d4 100644 --- a/src/fluidimage/calcul/interpolate/_bench_tps_matrix.py +++ b/src/fluidimage/calcul/interpolate/_bench_tps_matrix.py @@ -1,5 +1,4 @@ import numpy as np - from thin_plate_spline import ( compute_tps_matrix, compute_tps_matrix_numpy, diff --git a/src/fluidimage/calcul/interpolate/_try_cusolve.py b/src/fluidimage/calcul/interpolate/_try_cusolve.py index 07c9a8c5..954e36ca 100644 --- a/src/fluidimage/calcul/interpolate/_try_cusolve.py +++ b/src/fluidimage/calcul/interpolate/_try_cusolve.py @@ -2,7 +2,6 @@ import time import numpy as np - import pycuda.autoinit import pycuda.gpuarray as gpuarray diff --git a/src/fluidimage/calcul/interpolate/thin_plate_spline.py b/src/fluidimage/calcul/interpolate/thin_plate_spline.py index 3699c9e7..3085305b 100644 --- a/src/fluidimage/calcul/interpolate/thin_plate_spline.py +++ b/src/fluidimage/calcul/interpolate/thin_plate_spline.py @@ -28,7 +28,6 @@ """ import numpy as np - from transonic import Transonic, boost ts = Transonic() diff --git a/src/fluidimage/calcul/subpix.py b/src/fluidimage/calcul/subpix.py index fccf1bb4..b8db0994 100644 --- a/src/fluidimage/calcul/subpix.py +++ b/src/fluidimage/calcul/subpix.py @@ -8,7 +8,6 @@ """ import numpy as np - from transonic import boost from .errors import PIVError diff --git a/src/fluidimage/calibration/calib2d_simple.py b/src/fluidimage/calibration/calib2d_simple.py index 2a5f7180..4ed32a90 100644 --- a/src/fluidimage/calibration/calib2d_simple.py +++ b/src/fluidimage/calibration/calib2d_simple.py @@ -8,7 +8,6 @@ """ import numpy as np - from fluiddyn.io.image import imread diff --git a/src/fluidimage/calibration/calib_cv.py b/src/fluidimage/calibration/calib_cv.py index 38782b33..bd837268 100644 --- a/src/fluidimage/calibration/calib_cv.py +++ b/src/fluidimage/calibration/calib_cv.py @@ -19,11 +19,11 @@ import matplotlib.pyplot as plt import numpy as np +from fluiddyn.util.paramcontainer import ParamContainer from matplotlib.patches import Rectangle from matplotlib.transforms import Bbox from scipy.interpolate import griddata -from fluiddyn.util.paramcontainer import ParamContainer from fluidimage._opencv import cv2 diff --git a/src/fluidimage/calibration/calib_direct.py b/src/fluidimage/calibration/calib_direct.py index 2949aa99..63898b09 100644 --- a/src/fluidimage/calibration/calib_direct.py +++ b/src/fluidimage/calibration/calib_direct.py @@ -18,14 +18,13 @@ import matplotlib.pyplot as plt import numpy as np import pylab +from fluiddyn.util.paramcontainer import ParamContainer, tidy_container from scipy.interpolate import ( LinearNDInterpolator, RegularGridInterpolator, griddata, ) -from fluiddyn.util.paramcontainer import ParamContainer, tidy_container - from .util import get_base_from_normal_vector, get_number_from_string # from scipy.interpolate import CloughTocher2DInterpolator diff --git a/src/fluidimage/calibration/util.py b/src/fluidimage/calibration/util.py index faae0b21..d7e0b104 100644 --- a/src/fluidimage/calibration/util.py +++ b/src/fluidimage/calibration/util.py @@ -6,7 +6,6 @@ from math import cos, sin import numpy as np - from fluiddyn.util.paramcontainer import ParamContainer, tidy_container diff --git a/src/fluidimage/data_objects/piv.py b/src/fluidimage/data_objects/piv.py index b76e3708..694bcefd 100644 --- a/src/fluidimage/data_objects/piv.py +++ b/src/fluidimage/data_objects/piv.py @@ -25,8 +25,11 @@ import h5py import numpy as np -from fluidimage import ParamContainer, __version__ as fluidimage_version, imread +from fluidimage import ParamContainer +from fluidimage import __version__ as fluidimage_version +from fluidimage import imread from fluidimage._version import hg_rev + from .display_piv import DisplayPIV diff --git a/src/fluidimage/data_objects/preproc.py b/src/fluidimage/data_objects/preproc.py index 06666147..0ab8b861 100644 --- a/src/fluidimage/data_objects/preproc.py +++ b/src/fluidimage/data_objects/preproc.py @@ -15,8 +15,8 @@ import os import h5py - from fluiddyn.util.serieofarrays import SerieOfArraysFromFiles + from fluidimage.util import imsave, imsave_h5 from .piv import ArrayCouple, LightPIVResults diff --git a/src/fluidimage/executors/__init__.py b/src/fluidimage/executors/__init__.py index f91497ed..ec4cdda1 100644 --- a/src/fluidimage/executors/__init__.py +++ b/src/fluidimage/executors/__init__.py @@ -26,6 +26,7 @@ """ import os + import trio diff --git a/src/fluidimage/executors/exec_async_servers.py b/src/fluidimage/executors/exec_async_servers.py index 5cac0308..d005f79d 100644 --- a/src/fluidimage/executors/exec_async_servers.py +++ b/src/fluidimage/executors/exec_async_servers.py @@ -15,8 +15,8 @@ import numpy as np import trio - from fluiddyn import time_as_str + from fluidimage.util import log_debug, logger from .exec_async import ExecutorAsync diff --git a/src/fluidimage/executors/multi_exec_async.py b/src/fluidimage/executors/multi_exec_async.py index ae20869e..ba9502f0 100644 --- a/src/fluidimage/executors/multi_exec_async.py +++ b/src/fluidimage/executors/multi_exec_async.py @@ -22,6 +22,7 @@ from time import time from fluiddyn import time_as_str + from fluidimage.util import logger from .base import ExecutorBase diff --git a/src/fluidimage/executors/servers.py b/src/fluidimage/executors/servers.py index e49fa6c4..c749d5ba 100644 --- a/src/fluidimage/executors/servers.py +++ b/src/fluidimage/executors/servers.py @@ -28,8 +28,8 @@ from threading import Thread import trio - from fluiddyn.io.tee import MultiFile + from fluidimage.util import cstring, log_debug, log_memory_usage, logger diff --git a/src/fluidimage/gui/imviewer.py b/src/fluidimage/gui/imviewer.py index 68e4e798..227283a6 100644 --- a/src/fluidimage/gui/imviewer.py +++ b/src/fluidimage/gui/imviewer.py @@ -14,11 +14,10 @@ from glob import glob import matplotlib.pyplot as plt -from matplotlib.widgets import TextBox, Button - from fluiddyn.io.image import imread from fluiddyn.util import time_as_str from fluiddyn.util.serieofarrays import SerieOfArraysFromFiles +from matplotlib.widgets import Button, TextBox extensions = ["png", "tif", "tiff", "jpg", "jpeg", "bmp", "cine"] extensions = ["." + ext for ext in extensions] diff --git a/src/fluidimage/gui/launcher/main.py b/src/fluidimage/gui/launcher/main.py index 5823962c..86e1e99a 100644 --- a/src/fluidimage/gui/launcher/main.py +++ b/src/fluidimage/gui/launcher/main.py @@ -9,18 +9,20 @@ import sys try: - from matplotlib.backends.qt_compat import QtWidgets, QtGui + from matplotlib.backends.qt_compat import QtGui, QtWidgets except ImportError: base_classes = [] else: - from .mainwindow import Ui_MainWindow from fluiddyn.util.paramcontainer_gui import QtParamContainer + from .mainwindow import Ui_MainWindow + base_classes = [QtWidgets.QMainWindow, Ui_MainWindow] from fluiddyn.util.paramcontainer import ParamContainer + from fluidimage.topologies.launcher import ( TopologyPIVLauncher, TopologyPreprocLauncher, diff --git a/src/fluidimage/gui/launcher/mainwindow.py b/src/fluidimage/gui/launcher/mainwindow.py index 346199fd..d9680161 100644 --- a/src/fluidimage/gui/launcher/mainwindow.py +++ b/src/fluidimage/gui/launcher/mainwindow.py @@ -18,9 +18,9 @@ QPoint, QRect, QSize, + Qt, QTime, QUrl, - Qt, ) from PySide6.QtGui import ( QAction, diff --git a/src/fluidimage/gui/launcher/test_launcher.py b/src/fluidimage/gui/launcher/test_launcher.py index d3dcf82e..1d432bb3 100644 --- a/src/fluidimage/gui/launcher/test_launcher.py +++ b/src/fluidimage/gui/launcher/test_launcher.py @@ -1,7 +1,6 @@ -import pytest - # just to be sure that matplotlib is importable import matplotlib +import pytest try: import matplotlib.backends.qt_compat diff --git a/src/fluidimage/gui/test_imviewer.py b/src/fluidimage/gui/test_imviewer.py index 623ed78c..a2a265a8 100644 --- a/src/fluidimage/gui/test_imviewer.py +++ b/src/fluidimage/gui/test_imviewer.py @@ -2,10 +2,10 @@ import unittest from fluiddyn.io import stdout_redirected + from fluidimage import get_path_image_samples from fluidimage.gui.imviewer import ImageViewer, parse_args - path_image_samples = get_path_image_samples() diff --git a/src/fluidimage/gui/test_imviewer_pg.py b/src/fluidimage/gui/test_imviewer_pg.py index a8a4dcdc..53ca647c 100644 --- a/src/fluidimage/gui/test_imviewer_pg.py +++ b/src/fluidimage/gui/test_imviewer_pg.py @@ -4,6 +4,7 @@ try: import pyqtgraph + from fluidimage.gui.pg_main import main, parse_args use_pyqtgraph = True diff --git a/src/fluidimage/postproc/_try_postproc.py b/src/fluidimage/postproc/_try_postproc.py index 2db324c0..07d7ae19 100644 --- a/src/fluidimage/postproc/_try_postproc.py +++ b/src/fluidimage/postproc/_try_postproc.py @@ -1,10 +1,10 @@ import numpy as np import pylab - from fluiddyn.util.serieofarrays import SeriesOfArrays -from fluidimage.works.piv import WorkPIV from postproc import PIV_Postproc, PIV_PostProc_serie +from fluidimage.works.piv import WorkPIV + # %% params = WorkPIV.create_default_params() diff --git a/src/fluidimage/postproc/piv.py b/src/fluidimage/postproc/piv.py index 659fe647..776bcb30 100644 --- a/src/fluidimage/postproc/piv.py +++ b/src/fluidimage/postproc/piv.py @@ -16,11 +16,11 @@ """ import h5py - - from fluiddyn.util.paramcontainer import ParamContainer + from fluidimage.works.piv.multipass import WorkPIV -from .vector_field import VectorFieldOnGrid, ArrayOfVectorFieldsOnGrid + +from .vector_field import ArrayOfVectorFieldsOnGrid, VectorFieldOnGrid class PIV2d(VectorFieldOnGrid): diff --git a/src/fluidimage/postproc/postproc.py b/src/fluidimage/postproc/postproc.py index 2aa8c7f2..deb1cd59 100644 --- a/src/fluidimage/postproc/postproc.py +++ b/src/fluidimage/postproc/postproc.py @@ -7,12 +7,7 @@ from fluidimage.data_objects.piv import LightPIVResults -from .util import ( - compute_div, - compute_rot, - compute_1dspectrum, - compute_2dspectrum, -) +from .util import compute_1dspectrum, compute_2dspectrum, compute_div, compute_rot warn( "Functions and classes defined in this module (fluidimage.postproc.postproc)" diff --git a/src/fluidimage/postproc/test_piv.py b/src/fluidimage/postproc/test_piv.py index 0f5c9e3d..1181af1c 100644 --- a/src/fluidimage/postproc/test_piv.py +++ b/src/fluidimage/postproc/test_piv.py @@ -1,10 +1,10 @@ import unittest from shutil import rmtree -import numpy as np import h5py - +import numpy as np from fluiddyn.util.paramcontainer import ParamContainer + from fluidimage import get_path_image_samples from fluidimage.postproc.piv import ArrayPIV, PIV2d, get_grid_pixel_from_piv_file diff --git a/src/fluidimage/postproc/vector_field.py b/src/fluidimage/postproc/vector_field.py index 9e4767d1..45722da8 100644 --- a/src/fluidimage/postproc/vector_field.py +++ b/src/fluidimage/postproc/vector_field.py @@ -11,24 +11,23 @@ """ +import itertools from copy import deepcopy from numbers import Number -import itertools from typing import Optional +import h5py import matplotlib.pyplot as plt import numpy as np -import h5py -from scipy.ndimage import gaussian_filter, median_filter - from fluiddyn.util.paramcontainer import ParamContainer +from scipy.ndimage import gaussian_filter, median_filter from .util import ( - reshape_on_grid_final, - compute_rot, - compute_div, compute_1dspectrum, compute_2dspectrum, + compute_div, + compute_rot, + reshape_on_grid_final, ) diff --git a/src/fluidimage/preproc/_toolbox_cv.py b/src/fluidimage/preproc/_toolbox_cv.py index 9af9a8b2..28fd5e15 100644 --- a/src/fluidimage/preproc/_toolbox_cv.py +++ b/src/fluidimage/preproc/_toolbox_cv.py @@ -13,8 +13,8 @@ import numpy as np -from .io import iterate_multiple_imgs from .._opencv import cv2 +from .io import iterate_multiple_imgs __all__ = [ "sliding_median", diff --git a/src/fluidimage/preproc/image2image.py b/src/fluidimage/preproc/image2image.py index 9c5c04f8..b25e4487 100644 --- a/src/fluidimage/preproc/image2image.py +++ b/src/fluidimage/preproc/image2image.py @@ -17,7 +17,6 @@ import types import numpy as np - from fluiddyn.util import import_class from fluiddyn.util.serieofarrays import SerieOfArraysFromFiles diff --git a/src/fluidimage/preproc/test_base.py b/src/fluidimage/preproc/test_base.py index 815ff7df..94b4f7d2 100644 --- a/src/fluidimage/preproc/test_base.py +++ b/src/fluidimage/preproc/test_base.py @@ -5,6 +5,7 @@ from fluiddyn.io import stdout_redirected from fluiddyn.io.image import imread, imsave + from fluidimage import get_path_image_samples from fluidimage.preproc.base import PreprocBase diff --git a/src/fluidimage/reconstruct/tomo/mlos.py b/src/fluidimage/reconstruct/tomo/mlos.py index 4d4a275e..d0a3a013 100644 --- a/src/fluidimage/reconstruct/tomo/mlos.py +++ b/src/fluidimage/reconstruct/tomo/mlos.py @@ -213,6 +213,7 @@ def _estimate_max_array_size(dtype=np.float64): if __name__ == "__main__": import shutil + from fluidimage import get_path_image_samples path_image_samples = get_path_image_samples() diff --git a/src/fluidimage/reconstruct/tomo/test_mlos.py b/src/fluidimage/reconstruct/tomo/test_mlos.py index 707aaaf0..5d0ffabf 100644 --- a/src/fluidimage/reconstruct/tomo/test_mlos.py +++ b/src/fluidimage/reconstruct/tomo/test_mlos.py @@ -8,11 +8,11 @@ matplotlib.use("Agg") from fluiddyn.io import stdout_redirected + from fluidimage import get_path_image_samples from fluidimage.data_objects.tomo import ArrayTomoCV from fluidimage.reconstruct.tomo import TomoMLOSCV - path_calib = str(get_path_image_samples() / "TomoPIV" / "calibration" / "cam0.h5") path_particle = str( get_path_image_samples() diff --git a/src/fluidimage/run_from_xml.py b/src/fluidimage/run_from_xml.py index 48ab0492..5c6ebc74 100644 --- a/src/fluidimage/run_from_xml.py +++ b/src/fluidimage/run_from_xml.py @@ -18,9 +18,9 @@ import numpy as np import scipy - from fluiddyn.util import import_class from fluiddyn.util.paramcontainer import tidy_container + from fluidimage.topologies.piv import TopologyPIV from . import ( diff --git a/src/fluidimage/test_run_from_xml.py b/src/fluidimage/test_run_from_xml.py index ed4e0f2a..7ddaaa8d 100644 --- a/src/fluidimage/test_run_from_xml.py +++ b/src/fluidimage/test_run_from_xml.py @@ -3,6 +3,7 @@ import unittest from fluiddyn.io import stdout_redirected + from fluidimage import get_path_image_samples from fluidimage.run_from_xml import main diff --git a/src/fluidimage/topologies/example.py b/src/fluidimage/topologies/example.py index 9993ad00..89379589 100644 --- a/src/fluidimage/topologies/example.py +++ b/src/fluidimage/topologies/example.py @@ -14,11 +14,10 @@ import numpy as np import scipy.io - from transonic import boost -from . import TopologyBase from ..util import imread +from . import TopologyBase A = "uint8[:,:]" diff --git a/src/fluidimage/topologies/image2image.py b/src/fluidimage/topologies/image2image.py index bcfbb878..f7ad5bb5 100644 --- a/src/fluidimage/topologies/image2image.py +++ b/src/fluidimage/topologies/image2image.py @@ -12,6 +12,7 @@ from pathlib import Path from fluiddyn.io.image import imsave + from fluidimage import ParamContainer, SerieOfArraysFromFiles from fluidimage.preproc.image2image import ( complete_im2im_params_with_default, diff --git a/src/fluidimage/topologies/log.py b/src/fluidimage/topologies/log.py index f5d72597..09a7756e 100644 --- a/src/fluidimage/topologies/log.py +++ b/src/fluidimage/topologies/log.py @@ -13,7 +13,6 @@ import matplotlib.pyplot as plt import numpy as np - from fluiddyn.util import is_run_from_ipython if is_run_from_ipython(): diff --git a/src/fluidimage/topologies/preproc.py b/src/fluidimage/topologies/preproc.py index 414df84b..d3fba92a 100644 --- a/src/fluidimage/topologies/preproc.py +++ b/src/fluidimage/topologies/preproc.py @@ -14,6 +14,7 @@ from typing import Dict, List, Tuple from fluiddyn.util.paramcontainer import ParamContainer + from fluidimage import SeriesOfArrays from fluidimage.data_objects.preproc import ArraySerie as ArraySubset from fluidimage.data_objects.preproc import get_name_preproc diff --git a/src/fluidimage/topologies/surface_tracking.py b/src/fluidimage/topologies/surface_tracking.py index 603207fe..5d939d1f 100644 --- a/src/fluidimage/topologies/surface_tracking.py +++ b/src/fluidimage/topologies/surface_tracking.py @@ -20,6 +20,7 @@ from pathlib import Path from fluiddyn.io.image import imsave_h5 + from fluidimage import ParamContainer, SerieOfArraysFromFiles, SeriesOfArrays from fluidimage.topologies import prepare_path_dir_result from fluidimage.util import imread, logger diff --git a/src/fluidimage/topologies/test_preproc.py b/src/fluidimage/topologies/test_preproc.py index 13e8663b..98949761 100644 --- a/src/fluidimage/topologies/test_preproc.py +++ b/src/fluidimage/topologies/test_preproc.py @@ -3,6 +3,7 @@ from shutil import rmtree from fluiddyn.io.image import imread, imsave + from fluidimage import get_path_image_samples from fluidimage.topologies.preproc import TopologyPreproc diff --git a/src/fluidimage/util/util.py b/src/fluidimage/util/util.py index 98f5634a..6f43e390 100644 --- a/src/fluidimage/util/util.py +++ b/src/fluidimage/util/util.py @@ -21,12 +21,11 @@ from pathlib import Path import psutil -from IPython.lib.pretty import pretty - from fluiddyn.io.image import imread as _imread from fluiddyn.io.image import imsave as _imsave from fluiddyn.util import get_memory_usage from fluiddyn.util import terminal_colors as term +from IPython.lib.pretty import pretty color_dict = { "HEADER": term.HEADER, diff --git a/src/fluidimage/works/optical_flow.py b/src/fluidimage/works/optical_flow.py index 684d44d9..4be31171 100644 --- a/src/fluidimage/works/optical_flow.py +++ b/src/fluidimage/works/optical_flow.py @@ -7,11 +7,11 @@ """ import numpy as np - from fluiddyn.util.paramcontainer import ParamContainer from fluiddyn.util.serieofarrays import SerieOfArraysFromFiles -from fluidimage.data_objects.piv import ArrayCouple, HeavyPIVResults + from fluidimage._opencv import cv2 +from fluidimage.data_objects.piv import ArrayCouple, HeavyPIVResults from .with_mask import BaseWorkWithMask diff --git a/src/fluidimage/works/piv/fix.py b/src/fluidimage/works/piv/fix.py index d5939992..bb138f00 100644 --- a/src/fluidimage/works/piv/fix.py +++ b/src/fluidimage/works/piv/fix.py @@ -8,14 +8,13 @@ """ import numpy as np - from fluiddyn.util.paramcontainer import ParamContainer -from .. import BaseWork -from ...calcul.smooth_clean import smooth_clean - from fluidimage.calcul.errors import PIVError +from ...calcul.smooth_clean import smooth_clean +from .. import BaseWork + class WorkFIX(BaseWork): """Fix a displacement vector field.""" diff --git a/src/fluidimage/works/piv/multipass.py b/src/fluidimage/works/piv/multipass.py index ba3849dd..f4829080 100644 --- a/src/fluidimage/works/piv/multipass.py +++ b/src/fluidimage/works/piv/multipass.py @@ -11,10 +11,10 @@ from fluiddyn.util.paramcontainer import ParamContainer +from ...data_objects.piv import MultipassPIVResults +from .. import BaseWork from .fix import WorkFIX from .singlepass import FirstWorkPIV, InterpError, WorkPIVFromDisplacement -from .. import BaseWork -from ...data_objects.piv import MultipassPIVResults class WorkPIV(BaseWork): diff --git a/src/fluidimage/works/piv/singlepass.py b/src/fluidimage/works/piv/singlepass.py index 95ab981c..6d440c7d 100644 --- a/src/fluidimage/works/piv/singlepass.py +++ b/src/fluidimage/works/piv/singlepass.py @@ -27,16 +27,15 @@ from copy import deepcopy import numpy as np - from fluiddyn.util.serieofarrays import SerieOfArraysFromFiles -from ..with_mask import BaseWorkWithMask from ...calcul.correl import correlation_classes from ...calcul.errors import PIVError from ...calcul.interpolate.griddata import griddata from ...calcul.interpolate.thin_plate_spline_subdom import ThinPlateSplineSubdom from ...calcul.subpix import SubPix from ...data_objects.piv import ArrayCouple, HeavyPIVResults +from ..with_mask import BaseWorkWithMask class InterpError(ValueError): diff --git a/src/fluidimage/works/piv/test_piv.py b/src/fluidimage/works/piv/test_piv.py index bb772116..a0e10aa2 100644 --- a/src/fluidimage/works/piv/test_piv.py +++ b/src/fluidimage/works/piv/test_piv.py @@ -2,6 +2,7 @@ from shutil import rmtree from fluiddyn.io import stdout_redirected + from fluidimage import SeriesOfArrays, get_path_image_samples from fluidimage.data_objects.display_piv import DisplayPIV from fluidimage.data_objects.piv import LightPIVResults, MultipassPIVResults diff --git a/src/fluidimage/works/preproc.py b/src/fluidimage/works/preproc.py index 6db025f3..2078ff9d 100644 --- a/src/fluidimage/works/preproc.py +++ b/src/fluidimage/works/preproc.py @@ -14,7 +14,6 @@ import sys import numpy as np - from fluiddyn.util.serieofarrays import SerieOfArraysFromFiles from ..data_objects.preproc import ArraySerie, PreprocResults, get_ind_middle diff --git a/src/fluidimage/works/surface_tracking.py b/src/fluidimage/works/surface_tracking.py index ba06a6f1..6b80c292 100644 --- a/src/fluidimage/works/surface_tracking.py +++ b/src/fluidimage/works/surface_tracking.py @@ -36,9 +36,9 @@ import numpy as np import scipy.interpolate import scipy.io +from fluiddyn.util.paramcontainer import ParamContainer from skimage.transform import resize -from fluiddyn.util.paramcontainer import ParamContainer from fluidimage import SerieOfArraysFromFiles from fluidimage.util import imread, logger diff --git a/src/fluidimage/works/with_mask.py b/src/fluidimage/works/with_mask.py index 73bbfacf..3b35f43c 100644 --- a/src/fluidimage/works/with_mask.py +++ b/src/fluidimage/works/with_mask.py @@ -1,5 +1,5 @@ -from . import BaseWork from ..data_objects.piv import get_slices_from_strcrop +from . import BaseWork class BaseWorkWithMask(BaseWork):