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:
bmccandless
2020-07-23 12:27:53 -07:00
committed by GitHub
parent 83d572cde2
commit 0344cfacce
4 changed files with 35 additions and 5 deletions
+6 -4
View File
@@ -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):
+1 -1
View File
@@ -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"])