mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-03 09:38:11 +08:00
clean up type inferencing (#2332)
* unit tests for 64 bit conversion * clean up type handling * type inference tests * more type inference fixes * use schema to determine user intent for data typing * stop using deprecated API * fbs type encoding test * add missing test * add more tests * correctly infer X type for CXG adaptor * lint * fix typo * ts migration * cleanup from PR review * lint * PR review changes
This commit is contained in:
@@ -125,7 +125,11 @@ class AnndataAdaptor(DataAdaptor):
|
||||
|
||||
def _create_schema(self):
|
||||
self.schema = {
|
||||
"dataframe": {"nObs": self.cell_count, "nVar": self.gene_count, "type": str(self.data.X.dtype)},
|
||||
"dataframe": {
|
||||
"nObs": self.cell_count,
|
||||
"nVar": self.gene_count,
|
||||
**get_schema_type_hint_of_array(self.data.X),
|
||||
},
|
||||
"annotations": {
|
||||
"obs": {"index": self.parameters.get("obs_names"), "columns": []},
|
||||
"var": {"index": self.parameters.get("var_names"), "columns": []},
|
||||
@@ -335,7 +339,7 @@ class AnndataAdaptor(DataAdaptor):
|
||||
"""return the approximate distribution of the X matrix."""
|
||||
if self.X_approximate_distribution is None:
|
||||
"""Not yet evaluated."""
|
||||
assert(self.dataset_config.X_approximate_distribution == "auto")
|
||||
assert self.dataset_config.X_approximate_distribution == "auto"
|
||||
self.data = self.data.to_memory() # loads data
|
||||
self.X_approximate_distribution = estimate_distribution.estimate_approximate_distribution(self.data.X)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user