Skip to content

Commit

Permalink
Fix numpy.min on strings
Browse files Browse the repository at this point in the history
  • Loading branch information
michalk8 committed Nov 28, 2022
1 parent 26a9b49 commit 3d19b33
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion squidpy/pl/_spatial_utils.py
Expand Up @@ -700,7 +700,11 @@ def _map_color_seg(
cols = colors.to_rgba_array(color_vector.categories) # type: ignore
else:
val_im = map_array(seg, cell_id, cell_id) # replace with same seg id to remove missing segs
cols = cmap_params.cmap(cmap_params.norm(color_vector))
try:
cols = cmap_params.cmap(cmap_params.norm(color_vector))
except TypeError:
assert all(colors.is_color_like(c) for c in color_vector), "Not all values are color-like."
cols = colors.to_rgba_array(color_vector)

if seg_erosionpx is not None:
val_im[val_im == erosion(val_im, square(seg_erosionpx))] = 0
Expand Down

0 comments on commit 3d19b33

Please sign in to comment.