Skip to content

Commit ac3e891

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 18bc5d8 commit ac3e891

35 files changed

Lines changed: 23 additions & 43 deletions

File tree

‎draugr/drawers/mpl_drawers/discrete_scroll_plot.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
class DiscreteScrollPlot(MplDrawer):
2626
"""
2727
Waterfall plot
28-
only supports a single trajectory at a time, do not supply parallel trajectories to draw method, will get truncated to num actions, effectively dropping actions for other envs than the first."""
28+
only supports a single trajectory at a time, do not supply parallel trajectories to draw method, will get truncated to num actions, effectively dropping actions for other envs than the first.
29+
"""
2930

3031
@passes_kws_to(MplDrawer.__init__)
3132
def __init__(
@@ -43,7 +44,6 @@ def __init__(
4344
figure_size: Tuple[int, int] = None,
4445
**kwargs
4546
):
46-
4747
super().__init__(render=render, figure_size=figure_size, **kwargs)
4848
if not render:
4949
return

‎draugr/drawers/mpl_drawers/spectral/fast_fourier_transform_spectrogram.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
class FastFourierTransformSpectrogramPlot(MplDrawer):
2727
"""
2828
TODO: CENTER Align fft maybe, to mimick librosa stft
29-
Short Time Fourier Transform (STFT), with step size of 1 and window lenght of n_fft, and no window function ( TODO: Hanning Smoothing)"""
29+
Short Time Fourier Transform (STFT), with step size of 1 and window lenght of n_fft, and no window function ( TODO: Hanning Smoothing)
30+
"""
3031

3132
def __init__(
3233
self,

‎draugr/drawers/opencv_drawers/opencv_image_stream.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class OpencvImageStream(Drawer):
2828
def __init__(
2929
self, title: str = "NoName", render: bool = True, **kwargs: MutableMapping
3030
):
31-
3231
super().__init__(**kwargs)
3332
if not render:
3433
return

‎draugr/matlab_utilities/conversion.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@
1212
from typing import Any
1313

1414
try:
15-
1615
import matlab
1716
except ImportError:
18-
1917
raise ImportError("Matlab engine not installed")
2018
import numpy
2119
from scipy import sparse
@@ -181,7 +179,6 @@ def ndarray_to_matlab(numpy_array):
181179
order = "C"
182180

183181
if numpy.iscomplexobj(numpy_array): # complex case
184-
185182
matlab_array = matlab.double(
186183
initializer=None, size=(1, num_elements), is_complex=True
187184
) # create empty matlab.mlarray

‎draugr/metrics/metric_collection.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ def append(self, *args: Sequence, **kwargs: MutableMapping):
5252
:type args:
5353
:param kwargs:
5454
:type kwargs:"""
55-
for (arg, (k, v)) in zip(args, self._metrics.items()):
55+
for arg, (k, v) in zip(args, self._metrics.items()):
5656
self._metrics[k].append(arg)
5757

58-
for (k, v) in kwargs:
58+
for k, v in kwargs:
5959
self._metrics[k].append(v)
6060

6161
def remove_metric(self, name):

‎draugr/multiprocessing_utilities/pooled_queue_processor.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ class PooledQueueProcessor(object):
5555
This is a workaround of Pythons extremely slow interprocess communication pipes.
5656
The ideal solution would be to use a multiprocessing.queue, but it apparently communication is band
5757
limited.
58-
This solution has processes complete tasks (batches) and a thread add the results to a queue.queue."""
58+
This solution has processes complete tasks (batches) and a thread add the results to a queue.queue.
59+
"""
5960

6061
def __init__(
6162
self,
@@ -68,7 +69,6 @@ def __init__(
6869
fill_at_construction=True,
6970
blocking=True,
7071
):
71-
7272
if kwargs is None:
7373
kwargs = {}
7474

‎draugr/opencv_utilities/color_space/edge.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def to_edge(
4343

4444
ksize = kwargs.get("ksize", max(next_odd(max(*(img.shape)) // 100), 5))
4545
if method == ToEdgeMethodEnum.morph_gradient:
46-
4746
return cv2.morphologyEx(
4847
img,
4948
MorphTypeEnum.gradient.value,

‎draugr/opencv_utilities/color_space/noise.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def noise_filter(
4545
sigmaSpace=kwargs.get("sigmaSpace", 17),
4646
)
4747
elif method == NoiseFilterMethodEnum.gaussian_blur:
48-
4948
return cv2.GaussianBlur(
5049
img,
5150
ksize=(ksize, ksize),

‎draugr/opencv_utilities/drawing/masks/gauss_circles.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def ellipse_bbox(h, k, a, b, theta):
3939

4040
# ----------------------------------------------------------------------------
4141

42+
4243
# Rotated elliptical gradient - slow, Python-only approach
4344
def make_gradient_v1(width, height, h, k, a, b, theta):
4445
"""
@@ -76,6 +77,7 @@ def make_gradient_v1(width, height, h, k, a, b, theta):
7677

7778
# ----------------------------------------------------------------------------
7879

80+
7981
# Rotated elliptical gradient - faster, vectorized numpy approach
8082
def make_gradient_v2(width, height, h, k, a, b, theta):
8183
"""
@@ -111,7 +113,6 @@ def make_gradient_v2(width, height, h, k, a, b, theta):
111113

112114
# ============================================================================
113115
if __name__ == "__main__":
114-
115116
from pathlib import Path
116117
from warg import ensure_existence
117118
from draugr.opencv_utilities import show_image

‎draugr/opencv_utilities/windows/color_picker.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def interactive_hsv_color_picker(
5656
img = cv2.imread(str(p))
5757
output = img
5858
while 1:
59-
6059
h_min = cv2.getTrackbarPos(hmin_label, window_label)
6160
h_max = cv2.getTrackbarPos(hmax_label, window_label)
6261

0 commit comments

Comments
 (0)