From 56c094a390dec35a3cf5271f851aad276218ecaa Mon Sep 17 00:00:00 2001 From: Bento007 Date: Thu, 9 Jan 2025 13:44:39 -0800 Subject: [PATCH] undo upgrade --- cellxgene_schema_cli/cellxgene_schema/validate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cellxgene_schema_cli/cellxgene_schema/validate.py b/cellxgene_schema_cli/cellxgene_schema/validate.py index 25630556f..292cc8ec7 100644 --- a/cellxgene_schema_cli/cellxgene_schema/validate.py +++ b/cellxgene_schema_cli/cellxgene_schema/validate.py @@ -11,7 +11,7 @@ import numpy as np import pandas as pd import scipy -from anndata.abc import CSCDataset, CSRDataset +from anndata._core.sparse_dataset import SparseDataset from cellxgene_ontology_guide.ontology_parser import OntologyParser from scipy import sparse @@ -1319,7 +1319,7 @@ def _validate_raw_data(self, x: Union[np.ndarray, sparse.spmatrix], is_sparse_ma self.errors.append("All non-zero values in raw matrix must be positive integers of type numpy.float32.") def _validate_raw_data_with_in_tissue_0( - self, x: Union[np.ndarray, sparse.spmatrix, CSRDataset, CSCDataset], is_sparse_matrix: bool + self, x: Union[np.ndarray, sparse.spmatrix, SparseDataset], is_sparse_matrix: bool ): """ Special case validation checks for Visium data with is_single = True and in_tissue column in obs where in_tissue @@ -1330,7 +1330,7 @@ def _validate_raw_data_with_in_tissue_0( """ has_tissue_0_non_zero_row = False has_tissue_1_zero_row = False - if isinstance(x, (CSRDataset, CSCDataset)): + if isinstance(x, SparseDataset): x = x.to_memory() if is_sparse_matrix: nonzero_row_indices, _ = x.nonzero()