Skip to content

Sliding window improvements #931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
2 changes: 0 additions & 2 deletions src/squidpy/pl/_spatial_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,15 +466,13 @@ def _set_color_source_vec(
color_source_vector = adata.raw.obs_vector(value_to_plot)
else:
color_source_vector = adata.obs_vector(value_to_plot, layer=layer)

if not isinstance(color_source_vector.dtype, CategoricalDtype):
return None, color_source_vector, False

color_source_vector = pd.Categorical(color_source_vector) # convert, e.g., `pd.Series`
categories = color_source_vector.categories
if groups is not None:
color_source_vector = color_source_vector.remove_categories(categories.difference(groups))

color_map = _get_palette(
adata,
cluster_key=value_to_plot,
Expand Down
Loading
Loading