Skip to content

Commit 671ef5a

Browse files
committed
Run Ruff formatter
1 parent e141554 commit 671ef5a

File tree

19 files changed

+27
-29
lines changed

19 files changed

+27
-29
lines changed

colormaps/matplotlib_cmaps.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116

117117

118118
def rgb_colors_to_hex_list(
119-
colors: list[tuple[int, int, int]]
119+
colors: list[tuple[int, int, int]],
120120
) -> list[tuple[float, str]]:
121121
"""Convert a list of RGB colors to a list of tuples with the position of the color
122122
and the color in hex format. Positions evenly distributed between 0 and 1.
@@ -261,7 +261,6 @@ def append_non_mpl_colormaps(mpl_colormaps: CmapDictType, colormaps: CmapDictTyp
261261

262262

263263
def main(cmaps: CmapDictType, out_json_path: str = DEFAULT_COLORMAPS_PATH):
264-
265264
new_cmaps: dict[str, list[tuple[float, str]]] = {}
266265

267266
# Uniform colormaps with a .colors attribute that return a list of RGB colors

plotpy/builder/image.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ def image(
247247
)
248248
assert data.ndim == 2, "Data must have 2 dimensions"
249249
if pixel_size is None:
250-
assert (
251-
center_on is None
252-
), "Argument `pixel_size` must be specified when `center_on`"
250+
assert center_on is None, (
251+
"Argument `pixel_size` must be specified when `center_on`"
252+
)
253253
xmin, xmax = xdata
254254
ymin, ymax = ydata
255255
else:

plotpy/io.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,7 @@ def _imread_dcm(filename, **kwargs):
419419
arr = arr.reshape(spp, dcm.Rows, dcm.Columns)
420420
else:
421421
raise NotImplementedError(
422-
"This code only handles "
423-
"SamplesPerPixel > 1 if Bits Allocated = 8"
422+
"This code only handles SamplesPerPixel > 1 if Bits Allocated = 8"
424423
)
425424
else:
426425
arr = arr.reshape(dcm.Rows, dcm.Columns)

plotpy/items/image/filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
file=sys.stderr,
3131
)
3232
print(
33-
("try running :" "python setup.py build_ext --inplace -c mingw32"),
33+
("try running :python setup.py build_ext --inplace -c mingw32"),
3434
file=sys.stderr,
3535
)
3636
raise

plotpy/items/image/image_items.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
file=sys.stderr,
5151
)
5252
print(
53-
("try running :" "python setup.py build_ext --inplace -c mingw32"),
53+
("try running :python setup.py build_ext --inplace -c mingw32"),
5454
file=sys.stderr,
5555
)
5656
raise

plotpy/items/image/masked.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ def deserialize(
149149
def update_mask(self) -> None:
150150
"""Update mask"""
151151
if isinstance(self.data, np.ma.MaskedArray):
152-
153152
# Casting filling_value to data dtype, otherwise this may raise an error
154153
# in future versions of NumPy (at the time of writing, this raises a
155154
# DeprecationWarning "NumPy will stop allowing conversion of out-of-bound

plotpy/items/image/transform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
file=sys.stderr,
2727
)
2828
print(
29-
("try running :" "python setup.py build_ext --inplace -c mingw32"),
29+
("try running :python setup.py build_ext --inplace -c mingw32"),
3030
file=sys.stderr,
3131
)
3232
raise

plotpy/mathutils/colormap.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ def get_cmap_path(config_path: str):
136136
# Load custom colormaps path from the config file
137137
CUSTOM_COLORMAPS_PATH = get_cmap_path(
138138
CONF.get(
139-
"colormaps", "colormaps/custom", default="colormaps_custom.json" # type: ignore
139+
"colormaps",
140+
"colormaps/custom",
141+
default="colormaps_custom.json", # type: ignore
140142
)
141143
)
142144

plotpy/panels/contrastadjustment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def setup_actions(self) -> None:
543543
_("Full range"),
544544
icon=get_icon("full_range.png"),
545545
triggered=self.histogram.set_full_range,
546-
tip=_("Scale the image's display range " "according to data range"),
546+
tip=_("Scale the image's display range according to data range"),
547547
)
548548
outliers_ac = create_action(
549549
self,

plotpy/panels/csection/csitem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
file=sys.stderr,
2929
)
3030
print(
31-
("try running :" "python setup.py build_ext --inplace -c mingw32"),
31+
("try running :python setup.py build_ext --inplace -c mingw32"),
3232
file=sys.stderr,
3333
)
3434
raise

0 commit comments

Comments
 (0)