fix: Handle non-categorical columns with colors + update deprecated AnnData API (#2758)

Yeah that makes sense! Mergingg
This commit is contained in:
rwbaber
2026-02-24 13:37:57 -08:00
committed by GitHub
parent 7c7203bdfe
commit 5eb3021752
4 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -228,6 +228,6 @@ def convert_anndata_category_colors_to_cxg_category_colors(data):
# create the cellxgene color entry for this category
cxg_colors[category_name] = dict(
zip(data.obs[category_name].cat.categories, [convert_color_to_hex_format(c) for c in data.uns[uns_key]])
zip(data.obs[category_name].astype('category').cat.categories, [convert_color_to_hex_format(c) for c in data.uns[uns_key]])
)
return cxg_colors
+1 -1
View File
@@ -22,7 +22,7 @@ def corpora_get_versions_from_anndata(adata):
"""
# per Corpora AnnData spec, this is a corpora file if the following is true
if "version" not in adata.uns_keys():
if "version" not in list(adata.uns.keys()):
return None
version = adata.uns["version"]
if not isinstance(version, collections.abc.Mapping) or "corpora_schema_version" not in version: