Skip to content

Commit

Permalink
Merge branch 'topic/default/format' into 'branch/default'
Browse files Browse the repository at this point in the history
Format with black and isort

See merge request fluiddyn/fluidimage!62
  • Loading branch information
paugier committed Feb 18, 2024
2 parents 59e09ef + c38622e commit cd9ba20
Show file tree
Hide file tree
Showing 60 changed files with 76 additions and 74 deletions.
1 change: 1 addition & 0 deletions doc/examples/piv_as_real/job_piv.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""

import params_piv

from fluidimage.topologies.piv import TopologyPIV


Expand Down
1 change: 1 addition & 0 deletions doc/examples/piv_as_real/job_pre.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""

import params_pre

from fluidimage.topologies.preproc import TopologyPreproc

try:
Expand Down
3 changes: 2 additions & 1 deletion doc/examples/piv_as_real/params_pre.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions doc/examples/piv_as_real/try_piv.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""

import params_piv

from fluidimage import SeriesOfArrays
from fluidimage.works.piv import WorkPIV

Expand Down
3 changes: 2 additions & 1 deletion doc/examples/pivchallenge/bench_piv_2005C.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion doc/examples/pivchallenge/piv_2001A_topology.py
Original file line number Diff line number Diff line change
@@ -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*")
Expand Down
3 changes: 2 additions & 1 deletion doc/examples/pivchallenge/piv_2001A_work.py
Original file line number Diff line number Diff line change
@@ -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()

Expand Down
3 changes: 2 additions & 1 deletion doc/examples/pivchallenge/piv_2005C_topology.py
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
3 changes: 2 additions & 1 deletion doc/examples/pivchallenge/piv_2005C_work.py
Original file line number Diff line number Diff line change
@@ -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")

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}
Expand Down
4 changes: 2 additions & 2 deletions src/fluidimage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
1 change: 0 additions & 1 deletion src/fluidimage/calcul/correl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/calcul/correl_pycuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion src/fluidimage/calcul/interpolate/_bench_tps_matrix.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy as np

from thin_plate_spline import (
compute_tps_matrix,
compute_tps_matrix_numpy,
Expand Down
1 change: 0 additions & 1 deletion src/fluidimage/calcul/interpolate/_try_cusolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import time

import numpy as np

import pycuda.autoinit
import pycuda.gpuarray as gpuarray

Expand Down
1 change: 0 additions & 1 deletion src/fluidimage/calcul/interpolate/thin_plate_spline.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"""

import numpy as np

from transonic import Transonic, boost

ts = Transonic()
Expand Down
1 change: 0 additions & 1 deletion src/fluidimage/calcul/subpix.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"""

import numpy as np

from transonic import boost

from .errors import PIVError
Expand Down
1 change: 0 additions & 1 deletion src/fluidimage/calibration/calib2d_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"""

import numpy as np

from fluiddyn.io.image import imread


Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/calibration/calib_cv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 1 addition & 2 deletions src/fluidimage/calibration/calib_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/fluidimage/calibration/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from math import cos, sin

import numpy as np

from fluiddyn.util.paramcontainer import ParamContainer, tidy_container


Expand Down
5 changes: 4 additions & 1 deletion src/fluidimage/data_objects/piv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/data_objects/preproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/fluidimage/executors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"""

import os

import trio


Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/executors/exec_async_servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/fluidimage/executors/multi_exec_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from time import time

from fluiddyn import time_as_str

from fluidimage.util import logger

from .base import ExecutorBase
Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/executors/servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 1 addition & 2 deletions src/fluidimage/gui/imviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 4 additions & 2 deletions src/fluidimage/gui/launcher/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/gui/launcher/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
QPoint,
QRect,
QSize,
Qt,
QTime,
QUrl,
Qt,
)
from PySide6.QtGui import (
QAction,
Expand Down
3 changes: 1 addition & 2 deletions src/fluidimage/gui/launcher/test_launcher.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest

# just to be sure that matplotlib is importable
import matplotlib
import pytest

try:
import matplotlib.backends.qt_compat
Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/gui/test_imviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down
1 change: 1 addition & 0 deletions src/fluidimage/gui/test_imviewer_pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try:
import pyqtgraph

from fluidimage.gui.pg_main import main, parse_args

use_pyqtgraph = True
Expand Down
4 changes: 2 additions & 2 deletions src/fluidimage/postproc/_try_postproc.py
Original file line number Diff line number Diff line change
@@ -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()

Expand Down
6 changes: 3 additions & 3 deletions src/fluidimage/postproc/piv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
7 changes: 1 addition & 6 deletions src/fluidimage/postproc/postproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
Loading

0 comments on commit cd9ba20

Please sign in to comment.