mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-01 23:18:12 +08:00
Fix the app config for reembedding and add a test (#1664)
* Fix the app config for reembedding and add a test * Add scanpy to requirements-dev
This commit is contained in:
@@ -782,12 +782,14 @@ class DatasetConfig(BaseConfig):
|
||||
self.check_attr("embeddings__names", list)
|
||||
self.check_attr("embeddings__enable_reembedding", bool)
|
||||
|
||||
if self.app_config.server_config.single_dataset__datapath:
|
||||
server_config = self.app_config.server_config
|
||||
if server_config.single_dataset__datapath:
|
||||
if self.embeddings__enable_reembedding:
|
||||
matrix_data_loader = MatrixDataLoader(self.single_dataset__datapath, app_config=self.app_config)
|
||||
if matrix_data_loader.matrix_data_type() != MatrixDataType.H5AD:
|
||||
matrix_data_loader = MatrixDataLoader(
|
||||
server_config.single_dataset__datapath, app_config=self.app_config)
|
||||
if matrix_data_loader.matrix_data_type != MatrixDataType.H5AD:
|
||||
raise ConfigurationError("'enable-reembedding is only supported with H5AD files.")
|
||||
if self.adaptor__anndata_adaptor__backed:
|
||||
if server_config.adaptor__anndata_adaptor__backed:
|
||||
raise ConfigurationError("enable-reembedding is not supported when run in --backed mode.")
|
||||
|
||||
def handle_diffexp(self, context):
|
||||
|
||||
@@ -301,7 +301,7 @@ def layout_obs_get(request, data_adaptor):
|
||||
|
||||
|
||||
def layout_obs_put(request, data_adaptor):
|
||||
if not data_adaptor.dataset_config.embedding__enable_reembedding:
|
||||
if not data_adaptor.dataset_config.embeddings__enable_reembedding:
|
||||
return abort(HTTPStatus.NOT_IMPLEMENTED)
|
||||
|
||||
preferred_mimetype = request.accept_mimetypes.best_match(["application/octet-stream"])
|
||||
|
||||
Reference in New Issue
Block a user