Skip to content

Commit 4d9a2a9

Browse files
committed
STY: maint
1 parent 4263f48 commit 4d9a2a9

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/darsia/assistants/base_assistant.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def __init__(self, img: darsia.Image, **kwargs) -> None:
2727
"""Figure for analysis."""
2828
self.ax = kwargs.get("ax")
2929
"""Axes for analysis."""
30-
assert (self.fig is None) == (
31-
self.ax is None
32-
), "Both fig and ax must be None or not None."
30+
assert (self.fig is None) == (self.ax is None), (
31+
"Both fig and ax must be None or not None."
32+
)
3333
if self.fig is None and self.ax is None:
3434
self.fig = plt.figure() # self.name)
3535
if self.img.space_dim == 2:

src/darsia/assistants/labels_assistant.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""""Labels assistant built from modules."""
1+
"""Labels assistant built from modules."""
22

33
from typing import Optional
44
from warnings import warn
@@ -327,7 +327,6 @@ def __call__(self) -> np.ndarray:
327327
mask = np.zeros_like(self.labels.img, dtype=bool)
328328

329329
if points is not None and len(points) > 0:
330-
331330
# Identify corresponding labels
332331
labels = np.unique([self.labels.img[p[0], p[1]] for p in points])
333332

@@ -445,9 +444,9 @@ def __init__(
445444
self.cache_background = None
446445
"""Cache for background image."""
447446
if labels is None:
448-
assert (
449-
self.background is not None
450-
), "Background image required to initialize empty labels."
447+
assert self.background is not None, (
448+
"Background image required to initialize empty labels."
449+
)
451450
self.labels = darsia.Image(
452451
np.zeros_like(self.background.img, dtype=int),
453452
**self.background.metadata(),

0 commit comments

Comments
 (0)