Skip to content

Commit 144b88e

Browse files
committed
fix pre-commit
1 parent a4e5d76 commit 144b88e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/napari_spatialdata/_scatterwidgets.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ def clear_hover_highlight(self) -> None:
489489
def use_auto_range(self) -> None:
490490
"""Default display of the graph."""
491491
if self.lut is not None:
492+
assert self.color_vec is not None
492493
color_min = self.color_vec.min()
493494
color_max = self.color_vec.max()
494495

@@ -803,6 +804,7 @@ def create_lut_hist(self) -> pg.HistogramLUTItem:
803804
st["ticksVisible"] = False
804805
lut.gradient.restoreState(st)
805806

807+
assert self.color_vec is not None
806808
y, x = np.histogram(self.color_vec, bins="auto")
807809
lut.plot.setData(
808810
np.concatenate([[np.min(self.color_vec)], (x[:-1] + x[1:]) / 2, [np.max(self.color_vec)]]),
@@ -867,13 +869,15 @@ def get_brushes(self, event: Any = None) -> list[QColor] | None:
867869
# for discrete data
868870
if self.discrete_color_widget is not None:
869871

872+
assert self.color_vec is not None
870873
return [pg.mkBrush(*x) for x in self.discrete_color_widget.palette.map(self.color_vec + 1) * 255]
871874

872875
# for continuos data
873876
if self.lut is not None:
874877

875878
level_min, level_max = self.lut.getLevels()
876879

880+
assert self.color_vec is not None
877881
data = np.clip(self.color_vec, level_min, level_max)
878882
data = (data - level_min) / (level_max - level_min)
879883

0 commit comments

Comments
 (0)