From 3ebbb0ccbf91955fa27913ac73d73298e018311c Mon Sep 17 00:00:00 2001 From: Madison Dunitz Date: Mon, 20 Sep 2021 18:50:06 -0700 Subject: [PATCH] move common code into server, update tests and makefile (#2425) * move common code into server, update tests and makefile remove backend directory, refactor update smoke tests --- .bumpversion.cfg | 6 +-- .dockerignore | 2 +- .github/workflows/compatibility_tests.yml | 10 ++--- .github/workflows/push_tests.yml | 2 +- .gitignore | 6 +-- MANIFEST.in | 12 +++--- Makefile | 35 ++++++++---------- backend/common/Makefile | 11 ------ backend/server/Makefile | 22 ----------- backend/test/test_common/unit/__init__.py | 1 - .../test/test_server/performance/__init__.py | 0 backend/test/test_server/unit/cli/__init__.py | 0 .../test/test_server/unit/common/__init__.py | 0 .../test_server/unit/common/utils/__init__.py | 0 .../test/test_server/unit/compute/__init__.py | 0 .../test_server/unit/data_anndata/__init__.py | 0 client/Makefile | 4 +- pyproject.toml | 2 +- requirements.txt | 2 +- server/Makefile | 12 ++++++ {backend/server => server}/__init__.py | 4 +- {backend/server => server}/__main__.py | 3 +- {backend => server/app}/__init__.py | 0 {backend/server => server}/app/app.py | 10 ++--- {backend/server => server}/app/session.py | 0 {backend/common => server/cli}/__init__.py | 0 {backend/server => server}/cli/cli.py | 5 ++- {backend/server => server}/cli/launch.py | 10 ++--- {backend/server => server}/cli/prepare.py | 8 +++- {backend/server => server}/cli/upgrade.py | 0 .../compute => server/common}/__init__.py | 0 .../common/annotations}/__init__.py | 0 .../common/annotations/annotations.py | 6 +-- .../common/annotations/local_file_csv.py | 12 +++--- {backend => server}/common/colors.py | 2 +- .../fbs => server/common/compute}/__init__.py | 0 .../common/compute/diffexp_generic.py | 5 ++- .../common/compute/estimate_distribution.py | 2 +- .../common/config/__init__.py | 0 .../common/config/app_config.py | 10 ++--- .../common/config/base_config.py | 2 +- .../common/config/client_config.py | 2 +- .../common/config/dataset_config.py | 8 ++-- .../common/config/external_config.py | 6 +-- .../common/config/server_config.py | 12 +++--- {backend => server}/common/constants.py | 0 {backend/server => server}/common/corpora.py | 4 +- {backend => server}/common/errors.py | 0 .../common/fbs/NetEncoding/Column.py | 0 .../common/fbs/NetEncoding/Float32Array.py | 0 .../common/fbs/NetEncoding/Float64Array.py | 0 .../common/fbs/NetEncoding/Int32Array.py | 0 .../fbs/NetEncoding/JSONEncodedArray.py | 0 .../common/fbs/NetEncoding/Matrix.py | 0 .../common/fbs/NetEncoding/TypedArray.py | 0 .../common/fbs/NetEncoding/Uint32Array.py | 0 .../common/fbs/NetEncoding}/__init__.py | 0 .../app => server/common/fbs}/__init__.py | 0 {backend => server}/common/fbs/matrix.py | 18 ++++----- {backend => server}/common/genesets.py | 2 +- {backend/server => server}/common/health.py | 4 +- {backend/server => server}/common/rest.py | 10 ++--- .../cli => server/common/utils}/__init__.py | 0 .../common/utils/corpora_constants.py | 0 .../common/utils/data_locator.py | 0 .../common/utils/type_conversion_utils.py | 0 {backend => server}/common/utils/utils.py | 2 +- .../common => server/common/web}/__init__.py | 0 .../data_anndata}/__init__.py | 0 .../data_anndata/anndata_adaptor.py | 18 ++++----- .../utils => server/data_common}/__init__.py | 0 .../data_common/data_adaptor.py | 12 +++--- .../data_common/matrix_loader.py | 6 +-- {backend/server => server}/default_config.py | 0 .../server => server}/requirements-dev.txt | 0 .../requirements-prepare.txt | 0 {backend/server => server}/requirements.txt | 0 setup.cfg | 2 +- setup.py | 6 +-- {backend/test => test}/__init__.py | 2 +- {backend/test => test}/decode_fbs.py | 4 +- .../1e4dfec4-c0b2-46ad-a04e-ff3ffb3c0a8f.h5ad | Bin .../common/web => test/fixtures}/__init__.py | 0 .../a95c59b4-7f5d-4b80-ad53-a694834ca18b.h5ad | Bin .../fixtures/dataset_config_outline.py | 0 {backend/test => test}/fixtures/fixtures.py | 0 .../fixtures/hgnc_example.txt.gz | Bin {backend/test => test}/fixtures/nan.h5ad | Bin .../test => test}/fixtures/pbmc3k-CSC-gz.h5ad | Bin .../test => test}/fixtures/pbmc3k-CSR-gz.h5ad | Bin .../fixtures/pbmc3k-annotations.csv | 0 .../fixtures/pbmc3k-genesets.csv | 0 .../__attr.tdb | Bin .../__fragment_metadata.tdb | Bin .../fixtures/pbmc3k.cxg/X/__array_schema.tdb | Bin .../fixtures/pbmc3k.cxg/X/__lock.tdb | 0 .../fixtures/pbmc3k.cxg/__tiledb_group.tdb | 0 .../__attr.tdb | Bin .../__fragment_metadata.tdb | Bin .../cxg_group_metadata/__array_schema.tdb | Bin .../pbmc3k.cxg/cxg_group_metadata/__lock.tdb | 0 ...182255768_fa7617ae99f843929911e4bc7b03e3db | Bin .../pbmc3k.cxg/emb/__tiledb_group.tdb | 0 .../__attr.tdb | Bin .../__fragment_metadata.tdb | Bin .../emb/draw_graph_fr/__array_schema.tdb | Bin .../pbmc3k.cxg/emb/draw_graph_fr/__lock.tdb | 0 .../__attr.tdb | Bin .../__fragment_metadata.tdb | Bin .../pbmc3k.cxg/emb/pca/__array_schema.tdb | Bin .../fixtures/pbmc3k.cxg/emb/pca/__lock.tdb | 0 .../__attr.tdb | Bin .../__fragment_metadata.tdb | Bin .../pbmc3k.cxg/emb/tsne/__array_schema.tdb | Bin .../fixtures/pbmc3k.cxg/emb/tsne/__lock.tdb | 0 .../__attr.tdb | Bin .../__fragment_metadata.tdb | Bin .../pbmc3k.cxg/emb/umap/__array_schema.tdb | Bin .../fixtures/pbmc3k.cxg/emb/umap/__lock.tdb | 0 .../__fragment_metadata.tdb | Bin .../louvain.tdb | Bin .../louvain_var.tdb | Bin .../n_counts.tdb | Bin .../n_genes.tdb | Bin .../name_0.tdb | Bin .../name_0_var.tdb | Bin .../percent_mito.tdb | Bin .../pbmc3k.cxg/obs/__array_schema.tdb | Bin .../fixtures/pbmc3k.cxg/obs/__lock.tdb | 0 ...182255787_e19a340576a340db85c37b61b83dbe57 | Bin .../__fragment_metadata.tdb | Bin .../n_cells.tdb | Bin .../name_0.tdb | Bin .../name_0_var.tdb | Bin .../pbmc3k.cxg/var/__array_schema.tdb | Bin .../fixtures/pbmc3k.cxg/var/__lock.tdb | 0 ...182255771_5a3a50f0b360403eab0e427c429f574e | Bin .../test => test}/fixtures/pbmc3k_64.h5ad | Bin .../__attr.tdb | Bin .../__fragment_metadata.tdb | Bin .../pbmc3k_v0.cxg/X/__array_schema.tdb | Bin .../fixtures/pbmc3k_v0.cxg/X/__lock.tdb | 0 .../fixtures/pbmc3k_v0.cxg/__tiledb_group.tdb | 0 .../pbmc3k_v0.cxg/emb/__tiledb_group.tdb | 0 .../__attr.tdb | Bin .../__fragment_metadata.tdb | Bin .../emb/draw_graph_fr/__array_schema.tdb | Bin .../emb/draw_graph_fr/__lock.tdb | 0 .../__attr.tdb | Bin .../__fragment_metadata.tdb | Bin .../pbmc3k_v0.cxg/emb/pca/__array_schema.tdb | Bin .../fixtures/pbmc3k_v0.cxg/emb/pca/__lock.tdb | 0 .../__attr.tdb | Bin .../__fragment_metadata.tdb | Bin .../pbmc3k_v0.cxg/emb/tsne/__array_schema.tdb | Bin .../pbmc3k_v0.cxg/emb/tsne/__lock.tdb | 0 .../__attr.tdb | Bin .../__fragment_metadata.tdb | Bin .../pbmc3k_v0.cxg/emb/umap/__array_schema.tdb | Bin .../pbmc3k_v0.cxg/emb/umap/__lock.tdb | 0 .../__fragment_metadata.tdb | Bin .../louvain.tdb | Bin .../louvain_var.tdb | Bin .../n_counts.tdb | Bin .../n_genes.tdb | Bin .../name_0.tdb | Bin .../name_0_var.tdb | Bin .../percent_mito.tdb | Bin .../pbmc3k_v0.cxg/obs/__array_schema.tdb | Bin .../fixtures/pbmc3k_v0.cxg/obs/__lock.tdb | 0 ...858534024_e856aef5b0e244b1a4b7dde70cd864d0 | Bin .../__fragment_metadata.tdb | Bin .../n_cells.tdb | Bin .../name_0.tdb | Bin .../name_0_var.tdb | Bin .../pbmc3k_v0.cxg/var/__array_schema.tdb | Bin .../fixtures/pbmc3k_v0.cxg/var/__lock.tdb | 0 ...858533966_1362646d804b4982b35052a367633436 | Bin {backend/test => test}/fixtures/schema.json | 0 .../fixtures/server_config_outline.py | 0 .../fixtures/test_bad_config.yaml | 0 .../test => test}/fixtures/test_config.yaml | 0 .../compute => test/performance}/__init__.py | 0 .../performance/create_test_matrix.py | 0 .../performance/run_diffexp.py | 10 ++--- .../test_server => test}/unit/__init__.py | 24 ++++++------ .../unit/cli}/__init__.py | 0 .../unit/cli/test_launch.py | 4 +- .../unit/cli/test_prepare.py | 2 +- .../unit/cli/test_upgrade.py | 2 +- .../unit/common}/__init__.py | 0 .../unit/common/config/__init__.py | 2 +- .../unit/common/config/test_app_config.py | 13 ++++--- .../unit/common/config/test_base_config.py | 10 ++--- .../unit/common/config/test_dataset_config.py | 14 +++---- .../common/config/test_external_config.py | 13 ++++--- .../unit/common/config/test_server_config.py | 18 ++++----- .../unit/common/test_api.py | 10 ++--- .../unit/common/test_corpora.py | 6 +-- .../unit/common/test_nan_rest.py | 6 +-- .../unit/common/test_rest.py | 4 +- .../unit/common/test_writable_annotation.py | 8 ++-- .../unit/common/utils}/__init__.py | 0 .../unit/common/utils/test_utils.py | 10 ++--- .../unit/compute}/__init__.py | 0 .../unit/compute/test_diffexp_h5ad.py | 8 ++-- .../unit/compute/test_est_dist.py | 10 ++--- .../unit/data_anndata}/__init__.py | 0 .../unit/data_anndata/test_anndata_adaptor.py | 14 +++---- .../test_anndata_adaptor_data_load.py | 25 +++++++------ .../data_anndata/test_nan_anndata_adaptor.py | 12 +++--- .../unit/utils => test/unit/fbs}/__init__.py | 0 .../unit/fbs/test_matrix.py | 8 ++-- .../test_common => test}/unit/test_colors.py | 8 ++-- .../unit/utils}/__init__.py | 0 .../unit/utils/test_jsonify_strict.py | 2 +- .../unit/utils/test_type_conversion_utils.py | 2 +- 217 files changed, 277 insertions(+), 292 deletions(-) delete mode 100644 backend/common/Makefile delete mode 100644 backend/server/Makefile delete mode 100644 backend/test/test_common/unit/__init__.py delete mode 100644 backend/test/test_server/performance/__init__.py delete mode 100644 backend/test/test_server/unit/cli/__init__.py delete mode 100644 backend/test/test_server/unit/common/__init__.py delete mode 100644 backend/test/test_server/unit/common/utils/__init__.py delete mode 100644 backend/test/test_server/unit/compute/__init__.py delete mode 100644 backend/test/test_server/unit/data_anndata/__init__.py create mode 100644 server/Makefile rename {backend/server => server}/__init__.py (74%) rename {backend/server => server}/__main__.py (88%) rename {backend => server/app}/__init__.py (100%) rename {backend/server => server}/app/app.py (96%) rename {backend/server => server}/app/session.py (100%) rename {backend/common => server/cli}/__init__.py (100%) rename {backend/server => server}/cli/cli.py (84%) rename {backend/server => server}/cli/launch.py (98%) rename {backend/server => server}/cli/prepare.py (98%) rename {backend/server => server}/cli/upgrade.py (100%) rename {backend/common/compute => server/common}/__init__.py (100%) rename {backend/common/fbs/NetEncoding => server/common/annotations}/__init__.py (100%) rename {backend/server => server}/common/annotations/annotations.py (93%) rename {backend/server => server}/common/annotations/local_file_csv.py (96%) rename {backend => server}/common/colors.py (99%) rename {backend/common/fbs => server/common/compute}/__init__.py (100%) rename {backend => server}/common/compute/diffexp_generic.py (97%) rename {backend => server}/common/compute/estimate_distribution.py (98%) rename {backend/server => server}/common/config/__init__.py (100%) rename {backend/server => server}/common/config/app_config.py (95%) rename {backend/server => server}/common/config/base_config.py (98%) rename {backend/server => server}/common/config/client_config.py (97%) rename {backend/server => server}/common/config/dataset_config.py (96%) rename {backend/server => server}/common/config/external_config.py (89%) rename {backend/server => server}/common/config/server_config.py (94%) rename {backend => server}/common/constants.py (100%) rename {backend/server => server}/common/corpora.py (95%) rename {backend => server}/common/errors.py (100%) rename {backend => server}/common/fbs/NetEncoding/Column.py (100%) rename {backend => server}/common/fbs/NetEncoding/Float32Array.py (100%) rename {backend => server}/common/fbs/NetEncoding/Float64Array.py (100%) rename {backend => server}/common/fbs/NetEncoding/Int32Array.py (100%) rename {backend => server}/common/fbs/NetEncoding/JSONEncodedArray.py (100%) rename {backend => server}/common/fbs/NetEncoding/Matrix.py (100%) rename {backend => server}/common/fbs/NetEncoding/TypedArray.py (100%) rename {backend => server}/common/fbs/NetEncoding/Uint32Array.py (100%) rename {backend/common/utils => server/common/fbs/NetEncoding}/__init__.py (100%) rename {backend/server/app => server/common/fbs}/__init__.py (100%) rename {backend => server}/common/fbs/matrix.py (93%) rename {backend => server}/common/genesets.py (99%) rename {backend/server => server}/common/health.py (88%) rename {backend/server => server}/common/rest.py (98%) rename {backend/server/cli => server/common/utils}/__init__.py (100%) rename {backend/server => server}/common/utils/corpora_constants.py (100%) rename {backend => server}/common/utils/data_locator.py (100%) rename {backend => server}/common/utils/type_conversion_utils.py (100%) rename {backend => server}/common/utils/utils.py (98%) rename {backend/server/common => server/common/web}/__init__.py (100%) rename {backend/server/common/annotations => server/data_anndata}/__init__.py (100%) rename {backend/server => server}/data_anndata/anndata_adaptor.py (96%) rename {backend/server/common/utils => server/data_common}/__init__.py (100%) rename {backend/server => server}/data_common/data_adaptor.py (97%) rename {backend/server => server}/data_common/matrix_loader.py (91%) rename {backend/server => server}/default_config.py (100%) rename {backend/server => server}/requirements-dev.txt (100%) rename {backend/server => server}/requirements-prepare.txt (100%) rename {backend/server => server}/requirements.txt (100%) rename {backend/test => test}/__init__.py (82%) rename {backend/test => test}/decode_fbs.py (88%) rename {backend/test => test}/fixtures/1e4dfec4-c0b2-46ad-a04e-ff3ffb3c0a8f.h5ad (100%) rename {backend/server/common/web => test/fixtures}/__init__.py (100%) rename {backend/test => test}/fixtures/a95c59b4-7f5d-4b80-ad53-a694834ca18b.h5ad (100%) rename {backend/test => test}/fixtures/dataset_config_outline.py (100%) rename {backend/test => test}/fixtures/fixtures.py (100%) rename {backend/test => test}/fixtures/hgnc_example.txt.gz (100%) rename {backend/test => test}/fixtures/nan.h5ad (100%) rename {backend/test => test}/fixtures/pbmc3k-CSC-gz.h5ad (100%) rename {backend/test => test}/fixtures/pbmc3k-CSR-gz.h5ad (100%) rename {backend/test => test}/fixtures/pbmc3k-annotations.csv (100%) rename {backend/test => test}/fixtures/pbmc3k-genesets.csv (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/X/__1587182255882_1587182255882_f7aa6ccb49a944f9ab9e25b11bbfab4f/__attr.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/X/__1587182255882_1587182255882_f7aa6ccb49a944f9ab9e25b11bbfab4f/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/X/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/X/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/__tiledb_group.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/cxg_group_metadata/__1587182255763_1587182255763_88cd3d13926f4892af7230837bcc5178/__attr.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/cxg_group_metadata/__1587182255763_1587182255763_88cd3d13926f4892af7230837bcc5178/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/cxg_group_metadata/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/cxg_group_metadata/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/cxg_group_metadata/__meta/__1587182255768_1587182255768_fa7617ae99f843929911e4bc7b03e3db (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/__tiledb_group.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__1587182255875_1587182255875_e02a92b5d18f45e0a02031568f4633d4/__attr.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__1587182255875_1587182255875_e02a92b5d18f45e0a02031568f4633d4/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/pca/__1587182255827_1587182255827_8aeb4df5c2a74918b7aeeb6d34632e24/__attr.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/pca/__1587182255827_1587182255827_8aeb4df5c2a74918b7aeeb6d34632e24/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/pca/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/pca/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/tsne/__1587182255846_1587182255846_0b832c3ed3534b458e83c75726f2005f/__attr.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/tsne/__1587182255846_1587182255846_0b832c3ed3534b458e83c75726f2005f/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/tsne/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/tsne/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/umap/__1587182255867_1587182255867_44955ba2220c4ad59bbdbb6b26e21428/__attr.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/umap/__1587182255867_1587182255867_44955ba2220c4ad59bbdbb6b26e21428/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/umap/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/emb/umap/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/louvain.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/louvain_var.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/n_counts.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/n_genes.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/name_0.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/name_0_var.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/percent_mito.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/obs/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/obs/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/obs/__meta/__1587182255787_1587182255787_e19a340576a340db85c37b61b83dbe57 (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/n_cells.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/name_0.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/name_0_var.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/var/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/var/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k.cxg/var/__meta/__1587182255771_1587182255771_5a3a50f0b360403eab0e427c429f574e (100%) rename {backend/test => test}/fixtures/pbmc3k_64.h5ad (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/X/__1576858534264_1576858534264_4f12045b32ea45a490bdad087bac4dc3/__attr.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/X/__1576858534264_1576858534264_4f12045b32ea45a490bdad087bac4dc3/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/X/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/X/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/__tiledb_group.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/__tiledb_group.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__1576858534229_1576858534229_391cdd6b87b649dea76842dfa59ed0d9/__attr.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__1576858534229_1576858534229_391cdd6b87b649dea76842dfa59ed0d9/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/pca/__1576858534121_1576858534121_454903804a694b3b8ccdae56065664ba/__attr.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/pca/__1576858534121_1576858534121_454903804a694b3b8ccdae56065664ba/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/pca/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/pca/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/tsne/__1576858534161_1576858534161_aa4803e7e7be4b23bea35f5d62296f14/__attr.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/tsne/__1576858534161_1576858534161_aa4803e7e7be4b23bea35f5d62296f14/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/tsne/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/tsne/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/umap/__1576858534193_1576858534193_67d97bcdd3d1486985f5974b133cb496/__attr.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/umap/__1576858534193_1576858534193_67d97bcdd3d1486985f5974b133cb496/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/umap/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/emb/umap/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/louvain.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/louvain_var.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/n_counts.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/n_genes.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/name_0.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/name_0_var.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/percent_mito.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/obs/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/obs/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/obs/__meta/__1576858534024_1576858534024_e856aef5b0e244b1a4b7dde70cd864d0 (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/__fragment_metadata.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/n_cells.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/name_0.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/name_0_var.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/var/__array_schema.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/var/__lock.tdb (100%) rename {backend/test => test}/fixtures/pbmc3k_v0.cxg/var/__meta/__1576858533966_1576858533966_1362646d804b4982b35052a367633436 (100%) rename {backend/test => test}/fixtures/schema.json (100%) rename {backend/test => test}/fixtures/server_config_outline.py (100%) rename {backend/test => test}/fixtures/test_bad_config.yaml (100%) rename {backend/test => test}/fixtures/test_config.yaml (100%) rename {backend/server/compute => test/performance}/__init__.py (100%) rename {backend/test/test_server => test}/performance/create_test_matrix.py (100%) rename {backend/test/test_server => test}/performance/run_diffexp.py (90%) rename {backend/test/test_server => test}/unit/__init__.py (86%) rename {backend/server/data_anndata => test/unit/cli}/__init__.py (100%) rename {backend/test/test_server => test}/unit/cli/test_launch.py (88%) rename {backend/test/test_server => test}/unit/cli/test_prepare.py (88%) rename {backend/test/test_server => test}/unit/cli/test_upgrade.py (92%) rename {backend/server/data_common => test/unit/common}/__init__.py (100%) rename {backend/test/test_server => test}/unit/common/config/__init__.py (99%) rename {backend/test/test_server => test}/unit/common/config/test_app_config.py (94%) rename {backend/test/test_server => test}/unit/common/config/test_base_config.py (88%) rename {backend/test/test_server => test}/unit/common/config/test_dataset_config.py (91%) rename {backend/test/test_server => test}/unit/common/config/test_external_config.py (91%) rename {backend/test/test_server => test}/unit/common/config/test_server_config.py (87%) rename {backend/test/test_server => test}/unit/common/test_api.py (99%) rename {backend/test/test_server => test}/unit/common/test_corpora.py (97%) rename {backend/test/test_server => test}/unit/common/test_nan_rest.py (92%) rename {backend/test/test_server => test}/unit/common/test_rest.py (95%) rename {backend/test/test_server => test}/unit/common/test_writable_annotation.py (96%) rename {backend/test/fixtures => test/unit/common/utils}/__init__.py (100%) rename {backend/test/test_server => test}/unit/common/utils/test_utils.py (72%) rename {backend/test/test_common => test/unit/compute}/__init__.py (100%) rename {backend/test/test_server => test}/unit/compute/test_diffexp_h5ad.py (95%) rename {backend/test/test_server => test}/unit/compute/test_est_dist.py (94%) rename {backend/test/test_common/unit/fbs => test/unit/data_anndata}/__init__.py (100%) rename {backend/test/test_server => test}/unit/data_anndata/test_anndata_adaptor.py (96%) rename {backend/test/test_server => test}/unit/data_anndata/test_anndata_adaptor_data_load.py (78%) rename {backend/test/test_server => test}/unit/data_anndata/test_nan_anndata_adaptor.py (89%) rename {backend/test/test_common/unit/utils => test/unit/fbs}/__init__.py (100%) rename {backend/test/test_common => test}/unit/fbs/test_matrix.py (97%) rename {backend/test/test_common => test}/unit/test_colors.py (86%) rename {backend/test/test_server => test/unit/utils}/__init__.py (100%) rename {backend/test/test_common => test}/unit/utils/test_jsonify_strict.py (98%) rename {backend/test/test_common => test}/unit/utils/test_type_conversion_utils.py (99%) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index e006d997..e670b737 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -2,13 +2,13 @@ current_version = 0.18.0 commit = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)(?:-(?Prc)\.(?P\d+))? -serialize = +serialize = {major}.{minor}.{patch}-{prerel}.{prerelversion} {major}.{minor}.{patch} [bumpversion:part:prerel] optional_value = release -values = +values = rc release @@ -20,6 +20,6 @@ replace = version="{new_version}" search = "version": "{current_version}" replace = "version": "{new_version}" -[bumpversion:file:backend/server/__init__.py] +[bumpversion:file:server/__init__.py] search = __version__ = "{current_version}" replace = __version__ = "{new_version}" diff --git a/.dockerignore b/.dockerignore index 5840c85c..a7f3b242 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,4 +2,4 @@ bin client dist docs -backend +server diff --git a/.github/workflows/compatibility_tests.yml b/.github/workflows/compatibility_tests.yml index 190dbd29..b8a68bb8 100644 --- a/.github/workflows/compatibility_tests.yml +++ b/.github/workflows/compatibility_tests.yml @@ -41,8 +41,8 @@ jobs: run: | # 1. only install the dev requirements on top of what is in the cellxgene pip package sudo apt-get update && sudo apt-get install -y libhdf5-serial-dev - sed -i 's/-r requirements.txt//' backend/server/requirements-dev.txt - pip install -r backend/server/requirements-dev.txt + sed -i 's/-r requirements.txt//' server/requirements-dev.txt + pip install -r server/requirements-dev.txt # 2. install cellxgene make pydist install-dist # 3. install anndata @@ -71,8 +71,8 @@ jobs: cd cellxgene # 1. only install the dev requirements on top of what is in the cellxgene pip package make dev-env-client - sed -i 's/-r requirements.txt//' backend/server/requirements-dev.txt - pip install -r backend/server/requirements-dev.txt + sed -i 's/-r requirements.txt//' server/requirements-dev.txt + pip install -r server/requirements-dev.txt # 2. install cellxgene pip install --upgrade cellxgene # 3. install anndata @@ -99,7 +99,7 @@ jobs: - name: Install dependencies run: | cd cellxgene - sed -i -E 's/^anndata[>=]=[0-9]+.[0-9]+.[0-9]+$/anndata/g' backend/server/requirements.txt + sed -i -E 's/^anndata[>=]=[0-9]+.[0-9]+.[0-9]+$/anndata/g' server/requirements.txt make pydist install-dist dev-env pip install git+https://github.com/theislab/anndata - name: Tests diff --git a/.github/workflows/push_tests.yml b/.github/workflows/push_tests.yml index cc3e39d6..bdef6db0 100644 --- a/.github/workflows/push_tests.yml +++ b/.github/workflows/push_tests.yml @@ -69,7 +69,7 @@ jobs: - name: Unit tests run: | make unit-test-server unit-test-client - bash <(curl -s https://codecov.io/bash) -y .codecov.yml -k backend/server -cF backend,python,unitTest + bash <(curl -s https://codecov.io/bash) -y .codecov.yml -k server -cF server,python,unitTest cd client && ./node_modules/codecov/bin/codecov --yml=../.codecov.yml --root=../ --gcov-root=../ -C -F frontend,javascript,unitTest smoke-tests: diff --git a/.gitignore b/.gitignore index 78a9415b..c49d7b43 100644 --- a/.gitignore +++ b/.gitignore @@ -19,9 +19,9 @@ venv*/ cellxgene/ # client build -backend/server/common/web/static/* -backend/server/common/web/templates/ -backend/server/common/web/csp-hashes.json +server/common/web/static/* +server/common/web/templates/ +server/common/web/csp-hashes.json # eb build artifact.dir diff --git a/MANIFEST.in b/MANIFEST.in index 1e6f65ba..3a3b5b2b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,7 @@ -recursive-include backend/server/common/web/templates * -recursive-include backend/server/common/web/static * +recursive-include server/common/web/templates * +recursive-include server/common/web/static * -include backend/server/requirements.txt -include backend/server/requirements-prepare.txt -include backend/server/converters/schema/hgnc_complete_set.txt.gz -include backend/server/converters/schema/schema_definitions/* +include server/requirements.txt +include server/requirements-prepare.txt +include server/converters/schema/hgnc_complete_set.txt.gz +include server/converters/schema/schema_definitions/* diff --git a/Makefile b/Makefile index 5cf55de6..f1b452ae 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ include common.mk BUILDDIR := build CLIENTBUILD := $(BUILDDIR)/client -SERVERBUILD := $(BUILDDIR)/backend/server +SERVERBUILD := $(BUILDDIR)/server CLEANFILES := $(BUILDDIR)/ client/build build dist cellxgene.egg-info PART ?= patch @@ -22,7 +22,7 @@ clean-client: .PHONY: clean-server clean-server: - cd backend/server && $(MAKE) clean + cd server && $(MAKE) clean # BUILDING PACKAGE @@ -33,33 +33,26 @@ build-client: .PHONY: build build: clean build-client - git ls-files backend/server/ | grep -v 'backend/server/test/' | cpio -pdm $(BUILDDIR) + git ls-files server/ | cpio -pdm $(BUILDDIR) cp -r client/build/ $(CLIENTBUILD) $(call copy_client_assets,$(CLIENTBUILD),$(SERVERBUILD)) - cp backend/__init__.py $(BUILDDIR) - cp backend/__init__.py $(BUILDDIR)/backend - cp -r backend/common $(BUILDDIR)/backend/common cp MANIFEST.in README.md setup.cfg setup.py $(BUILDDIR) # If you are actively developing in the server folder use this, dirties the source tree .PHONY: build-for-server-dev -build-for-server-dev: clean-server build-client - $(call copy_client_assets,client/build,backend/server) +build-for-server-dev: clean-server build-client copy-client-assets .PHONY: copy-client-assets copy-client-assets: - $(call copy_client_assets,client/build,backend/server) + $(call copy_client_assets,client/build,server) -.PHONY: copy-client-assets-czi-hosted -copy-client-assets-czi-hosted: - $(call copy_client_assets,client/build) # TESTING .PHONY: test test: unit-test smoke-test .PHONY: unit-test -unit-test: unit-test-server unit-test-client unit-test-common +unit-test: unit-test-server unit-test-client .PHONY: test-server test-server: unit-test-server smoke-test @@ -70,11 +63,13 @@ unit-test-client: .PHONY: unit-test-server unit-test-server: - cd backend/server && $(MAKE) unit-test - -.PHONY: unit-test-common -unit-test-common: - cd backend/common && $(MAKE) unit-test + PYTHONWARNINGS=ignore:ResourceWarning coverage run \ + --source=server \ + --omit=.coverage,venv \ + -m unittest discover \ + --start-directory test/unit \ + --verbose; test_result=$$?; \ + exit $$test_result \ .PHONY: smoke-test smoke-test: @@ -103,7 +98,7 @@ lint: lint-server lint-client .PHONY: lint-server lint-server: fmt-py - flake8 backend/server --per-file-ignores='backend/test/fixtures/dataset_config_outline.py:F821 backend/test/fixtures/server_config_outline.py:F821 backend/server/test/performance/scale_test_annotations.py:E501' + flake8 server --per-file-ignores='test/fixtures/dataset_config_outline.py:F821 test/fixtures/server_config_outline.py:F821 test/performance/scale_test_annotations.py:E501' .PHONY: lint-client lint-client: @@ -163,7 +158,7 @@ dev-env-client: .PHONY: dev-env-server dev-env-server: - pip install -r backend/server/requirements-dev.txt + pip install -r server/requirements-dev.txt # Increments the release candidate version (i.e. 0.16.2-rc.1 -> 0.16.2-rc.2) .PHONY: bump-release-candidate diff --git a/backend/common/Makefile b/backend/common/Makefile deleted file mode 100644 index 767c7f58..00000000 --- a/backend/common/Makefile +++ /dev/null @@ -1,11 +0,0 @@ - -.PHONY: unit-test -unit-test: - PYTHONWARNINGS=ignore:ResourceWarning coverage run \ - --source=fbs,utils \ - --omit=.coverage,data_common/fbs/NetEncoding,venv \ - -m unittest discover \ - --start-directory ../test/test_common/unit \ - --top-level-directory ../../ \ - --verbose; test_result=$$?; \ - exit $$test_result \ diff --git a/backend/server/Makefile b/backend/server/Makefile deleted file mode 100644 index feb164b7..00000000 --- a/backend/server/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -include ../../common.mk - -.PHONY: clean -clean: - rm -f common/web/templates/index.html - rm -rf common/web/static - rm -f common/web/csp-hashes.json - -.PHONY: unit-test -unit-test: - PYTHONWARNINGS=ignore:ResourceWarning coverage run \ - --source=app,cli,common,compute,converters,data_anndata,data_common \ - --omit=.coverage,venv \ - -m unittest discover \ - --start-directory ../test/test_server/unit \ - --top-level-directory ../../ \ - --verbose; test_result=$$?; \ - exit $$test_result \ - -.PHONY: test-annotations-performance -test-annotations-performance: - python ../test/test_server/performance/performance_test_annotations_backend.py diff --git a/backend/test/test_common/unit/__init__.py b/backend/test/test_common/unit/__init__.py deleted file mode 100644 index 8b137891..00000000 --- a/backend/test/test_common/unit/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/backend/test/test_server/performance/__init__.py b/backend/test/test_server/performance/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/backend/test/test_server/unit/cli/__init__.py b/backend/test/test_server/unit/cli/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/backend/test/test_server/unit/common/__init__.py b/backend/test/test_server/unit/common/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/backend/test/test_server/unit/common/utils/__init__.py b/backend/test/test_server/unit/common/utils/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/backend/test/test_server/unit/compute/__init__.py b/backend/test/test_server/unit/compute/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/backend/test/test_server/unit/data_anndata/__init__.py b/backend/test/test_server/unit/data_anndata/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/client/Makefile b/client/Makefile index e5621544..482f6640 100644 --- a/client/Makefile +++ b/client/Makefile @@ -1,7 +1,7 @@ include ../common.mk -ANNOTATIONS := $(if $(ANNOTATIONS),$(ANNOTATIONS),../backend/test/fixtures/pbmc3k-annotations.csv) -GENE_SETS := $(if $(GENE_SETS),$(GENE_SETS),../backend/test/fixtures/pbmc3k-genesets.csv) +ANNOTATIONS := $(if $(ANNOTATIONS),$(ANNOTATIONS),../test/fixtures/pbmc3k-annotations.csv) +GENE_SETS := $(if $(GENE_SETS),$(GENE_SETS),../test/fixtures/pbmc3k-genesets.csv) ANNOTATIONS_FILENAME := $(shell basename $(ANNOTATIONS)) GENE_SETS_FILENAME := $(shell basename $(GENE_SETS)) diff --git a/pyproject.toml b/pyproject.toml index 3c935f81..aced9108 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ exclude = ''' | buck-out | build | dist - | backend/server/data_common/fbs/NetEncoding + | server/common/fbs/NetEncoding )/ ) diff --git a/requirements.txt b/requirements.txt index d0b79a91..815cac2f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ --r ./backend/server/requirements.txt +-r ./server/requirements.txt diff --git a/server/Makefile b/server/Makefile new file mode 100644 index 00000000..0ddfb9cd --- /dev/null +++ b/server/Makefile @@ -0,0 +1,12 @@ +include ../common.mk + +.PHONY: clean +clean: + rm -f common/web/templates/index.html + rm -rf common/web/static + rm -f common/web/csp-hashes.json + + +.PHONY: test-annotations-performance +test-annotations-performance: + python ../test/performance/performance_test_annotations.py diff --git a/backend/server/__init__.py b/server/__init__.py similarity index 74% rename from backend/server/__init__.py rename to server/__init__.py index 4f332f1c..01c0a037 100644 --- a/backend/server/__init__.py +++ b/server/__init__.py @@ -1,12 +1,12 @@ import logging import sys -from backend.common.utils.utils import import_plugins +from server.common.utils.utils import import_plugins __version__ = "0.18.0" display_version = "cellxgene v" + __version__ try: - import_plugins("backend.server.plugins") + import_plugins("server.plugins") except Exception as e: # Make sure to exit in this case, as the server may not be configured as expected. logging.critical(f"Error in import_plugins: {str(e)}") diff --git a/backend/server/__main__.py b/server/__main__.py similarity index 88% rename from backend/server/__main__.py rename to server/__main__.py index ff21365d..b582e892 100644 --- a/backend/server/__main__.py +++ b/server/__main__.py @@ -5,7 +5,8 @@ if __package__ is None: PKG_PATH = Path(__file__).parent sys.path.insert(0, str(PKG_PATH.parent)) - import backend.server # noqa F401 + import server # noqa F401 + __package__ = PKG_PATH.name # Main thing diff --git a/backend/__init__.py b/server/app/__init__.py similarity index 100% rename from backend/__init__.py rename to server/app/__init__.py diff --git a/backend/server/app/app.py b/server/app/app.py similarity index 96% rename from backend/server/app/app.py rename to server/app/app.py index bc283cc9..94a62a1d 100644 --- a/backend/server/app/app.py +++ b/server/app/app.py @@ -13,12 +13,12 @@ from flask import ( ) from flask_restful import Api, Resource -import backend.server.common.rest as common_rest -from backend.common.errors import DatasetAccessError, RequestException -from backend.server.common.health import health_check -from backend.common.utils.utils import StrictJSONEncoder +import server.common.rest as common_rest +from server.common.errors import DatasetAccessError, RequestException +from server.common.health import health_check +from server.common.utils.utils import StrictJSONEncoder -webbp = Blueprint("webapp", "backend.server.common.web", template_folder="templates") +webbp = Blueprint("webapp", "server.common.web", template_folder="templates") ONE_WEEK = 7 * 24 * 60 * 60 diff --git a/backend/server/app/session.py b/server/app/session.py similarity index 100% rename from backend/server/app/session.py rename to server/app/session.py diff --git a/backend/common/__init__.py b/server/cli/__init__.py similarity index 100% rename from backend/common/__init__.py rename to server/cli/__init__.py diff --git a/backend/server/cli/cli.py b/server/cli/cli.py similarity index 84% rename from backend/server/cli/cli.py rename to server/cli/cli.py index 7dbb9122..15c3b3bd 100644 --- a/backend/server/cli/cli.py +++ b/server/cli/cli.py @@ -20,7 +20,10 @@ from .. import __version__ help="Show the software version and exit.", ) @click.option( - "--upgrade-check/--no-upgrade-check", default=True, show_default=True, help="Check for release upgrades on start.", + "--upgrade-check/--no-upgrade-check", + default=True, + show_default=True, + help="Check for release upgrades on start.", ) def cli(upgrade_check): if upgrade_check: diff --git a/backend/server/cli/launch.py b/server/cli/launch.py similarity index 98% rename from backend/server/cli/launch.py rename to server/cli/launch.py index 7fb49b0b..fe483210 100644 --- a/backend/server/cli/launch.py +++ b/server/cli/launch.py @@ -8,11 +8,11 @@ import click from flask_compress import Compress from flask_cors import CORS -from backend.server.default_config import default_config -from backend.server.app.app import Server -from backend.server.common.config.app_config import AppConfig -from backend.common.errors import DatasetAccessError, ConfigurationError -from backend.common.utils.utils import sort_options +from server.default_config import default_config +from server.app.app import Server +from server.common.config.app_config import AppConfig +from server.common.errors import DatasetAccessError, ConfigurationError +from server.common.utils.utils import sort_options DEFAULT_CONFIG = AppConfig() diff --git a/backend/server/cli/prepare.py b/server/cli/prepare.py similarity index 98% rename from backend/server/cli/prepare.py rename to server/cli/prepare.py index 5b6b467e..87bec01a 100644 --- a/backend/server/cli/prepare.py +++ b/server/cli/prepare.py @@ -5,7 +5,7 @@ import pandas as pd from numpy import ndarray, unique from scipy.sparse.csc import csc_matrix -from backend.common.utils.utils import sort_options +from server.common.utils.utils import sort_options @sort_options @@ -24,7 +24,11 @@ from backend.common.utils.utils import sort_options show_default=True, ) @click.option( - "--recipe", "-r", default="none", type=click.Choice(["none", "seurat", "zheng17"]), show_default=True, + "--recipe", + "-r", + default="none", + type=click.Choice(["none", "seurat", "zheng17"]), + show_default=True, ) @click.option("--output", "-o", default="", help="Save a new file to filename.", metavar="") @click.option("--plotting", "-p", default=False, is_flag=True, help="Generate plots.", show_default=True) diff --git a/backend/server/cli/upgrade.py b/server/cli/upgrade.py similarity index 100% rename from backend/server/cli/upgrade.py rename to server/cli/upgrade.py diff --git a/backend/common/compute/__init__.py b/server/common/__init__.py similarity index 100% rename from backend/common/compute/__init__.py rename to server/common/__init__.py diff --git a/backend/common/fbs/NetEncoding/__init__.py b/server/common/annotations/__init__.py similarity index 100% rename from backend/common/fbs/NetEncoding/__init__.py rename to server/common/annotations/__init__.py diff --git a/backend/server/common/annotations/annotations.py b/server/common/annotations/annotations.py similarity index 93% rename from backend/server/common/annotations/annotations.py rename to server/common/annotations/annotations.py index ead9f80d..255b5f0a 100644 --- a/backend/server/common/annotations/annotations.py +++ b/server/common/annotations/annotations.py @@ -1,8 +1,8 @@ from abc import ABCMeta, abstractmethod -from backend.common.errors import DisabledFeatureError -from backend.common.utils.type_conversion_utils import get_schema_type_hint_of_array -from backend.common.genesets import write_gene_sets_tidycsv +from server.common.errors import DisabledFeatureError +from server.common.utils.type_conversion_utils import get_schema_type_hint_of_array +from server.common.genesets import write_gene_sets_tidycsv class Annotations(metaclass=ABCMeta): diff --git a/backend/server/common/annotations/local_file_csv.py b/server/common/annotations/local_file_csv.py similarity index 96% rename from backend/server/common/annotations/local_file_csv.py rename to server/common/annotations/local_file_csv.py index 2ca8ab99..46dd25b1 100644 --- a/backend/server/common/annotations/local_file_csv.py +++ b/server/common/annotations/local_file_csv.py @@ -8,12 +8,12 @@ from hashlib import blake2b import pandas as pd from flask import session -from backend.server import __version__ as cellxgene_version -from backend.server.app.session import get_user_id -from backend.server.common.annotations.annotations import Annotations -from backend.common.genesets import read_gene_sets_tidycsv -from backend.common.errors import AnnotationsError, ObsoleteRequest -from backend.common.utils.data_locator import DataLocator +from server import __version__ as cellxgene_version +from server.app.session import get_user_id +from server.common.annotations.annotations import Annotations +from server.common.genesets import read_gene_sets_tidycsv +from server.common.errors import AnnotationsError, ObsoleteRequest +from server.common.utils.data_locator import DataLocator class AnnotationsLocalFile(Annotations): diff --git a/backend/common/colors.py b/server/common/colors.py similarity index 99% rename from backend/common/colors.py rename to server/common/colors.py index cd22091f..17f9eb56 100644 --- a/backend/common/colors.py +++ b/server/common/colors.py @@ -1,6 +1,6 @@ import re -from backend.common.errors import ColorFormatException +from server.common.errors import ColorFormatException HEX_COLOR_FORMAT = re.compile("^#[a-fA-F0-9]{6,6}$") diff --git a/backend/common/fbs/__init__.py b/server/common/compute/__init__.py similarity index 100% rename from backend/common/fbs/__init__.py rename to server/common/compute/__init__.py diff --git a/backend/common/compute/diffexp_generic.py b/server/common/compute/diffexp_generic.py similarity index 97% rename from backend/common/compute/diffexp_generic.py rename to server/common/compute/diffexp_generic.py index 92d532ef..be30af6d 100644 --- a/backend/common/compute/diffexp_generic.py +++ b/server/common/compute/diffexp_generic.py @@ -1,6 +1,6 @@ import numpy as np from scipy import sparse, stats -from backend.common.constants import XApproximateDistribution +from server.common.constants import XApproximateDistribution def diffexp_ttest(adaptor, maskA, maskB, top_n=8, diffexp_lfc_cutoff=0.01): @@ -27,7 +27,8 @@ def diffexp_ttest(adaptor, maskA, maskB, top_n=8, diffexp_lfc_cutoff=0.01): :param top_n: number of variables to return stats for :param diffexp_lfc_cutoff: minimum absolute value returning [ varindex, logfoldchange, pval, pval_adj ] for top N genes - :return: for top N genes, {"positive": for top N genes, [ varindex, foldchange, pval, pval_adj ], "negative": for top N genes, [ varindex, foldchange, pval, pval_adj ]} + :return: for top N genes, {"positive": for top N genes, [ varindex, foldchange, pval, pval_adj ], + "negative": for top N genes, [ varindex, foldchange, pval, pval_adj ]} """ X_approximate_distribution = adaptor.get_X_approximate_distribution() diff --git a/backend/common/compute/estimate_distribution.py b/server/common/compute/estimate_distribution.py similarity index 98% rename from backend/common/compute/estimate_distribution.py rename to server/common/compute/estimate_distribution.py index 33703f3c..c60d6a08 100644 --- a/backend/common/compute/estimate_distribution.py +++ b/server/common/compute/estimate_distribution.py @@ -3,7 +3,7 @@ import numba import concurrent.futures import numpy as np from scipy import sparse -from backend.common.constants import XApproximateDistribution +from server.common.constants import XApproximateDistribution @numba.njit(error_model="numpy", nogil=True) diff --git a/backend/server/common/config/__init__.py b/server/common/config/__init__.py similarity index 100% rename from backend/server/common/config/__init__.py rename to server/common/config/__init__.py diff --git a/backend/server/common/config/app_config.py b/server/common/config/app_config.py similarity index 95% rename from backend/server/common/config/app_config.py rename to server/common/config/app_config.py index 331d411d..70206cd7 100644 --- a/backend/server/common/config/app_config.py +++ b/server/common/config/app_config.py @@ -1,11 +1,11 @@ import yaml from flatten_dict import unflatten -from backend.server.default_config import get_default_config -from backend.server.common.config.dataset_config import DatasetConfig -from backend.server.common.config.server_config import ServerConfig -from backend.server.common.config.external_config import ExternalConfig -from backend.common.errors import ConfigurationError +from server.default_config import get_default_config +from server.common.config.dataset_config import DatasetConfig +from server.common.config.server_config import ServerConfig +from server.common.config.external_config import ExternalConfig +from server.common.errors import ConfigurationError class AppConfig(object): diff --git a/backend/server/common/config/base_config.py b/server/common/config/base_config.py similarity index 98% rename from backend/server/common/config/base_config.py rename to server/common/config/base_config.py index 1c4922f3..2fb7483e 100644 --- a/backend/server/common/config/base_config.py +++ b/server/common/config/base_config.py @@ -1,7 +1,7 @@ import copy from flatten_dict import flatten -from backend.common.errors import ConfigurationError +from server.common.errors import ConfigurationError class BaseConfig(object): diff --git a/backend/server/common/config/client_config.py b/server/common/config/client_config.py similarity index 97% rename from backend/server/common/config/client_config.py rename to server/common/config/client_config.py index 8cb02c33..bd741ec3 100644 --- a/backend/server/common/config/client_config.py +++ b/server/common/config/client_config.py @@ -1,4 +1,4 @@ -from backend.server import display_version as cellxgene_display_version +from server import display_version as cellxgene_display_version def get_client_config(app_config, data_adaptor): diff --git a/backend/server/common/config/dataset_config.py b/server/common/config/dataset_config.py similarity index 96% rename from backend/server/common/config/dataset_config.py rename to server/common/config/dataset_config.py index b77049c2..fee0d726 100644 --- a/backend/server/common/config/dataset_config.py +++ b/server/common/config/dataset_config.py @@ -1,10 +1,10 @@ import os from os.path import splitext, isdir -from backend.server.common.annotations.local_file_csv import AnnotationsLocalFile -from backend.server.common.config.base_config import BaseConfig -from backend.common.errors import ConfigurationError, AnnotationsError -from backend.server.data_common.matrix_loader import MatrixDataLoader +from server.common.annotations.local_file_csv import AnnotationsLocalFile +from server.common.config.base_config import BaseConfig +from server.common.errors import ConfigurationError, AnnotationsError +from server.data_common.matrix_loader import MatrixDataLoader class DatasetConfig(BaseConfig): diff --git a/backend/server/common/config/external_config.py b/server/common/config/external_config.py similarity index 89% rename from backend/server/common/config/external_config.py rename to server/common/config/external_config.py index 5bf8223b..ebab8fd6 100644 --- a/backend/server/common/config/external_config.py +++ b/server/common/config/external_config.py @@ -1,8 +1,8 @@ import os -from backend.server.common.config.base_config import BaseConfig -from backend.common.errors import ConfigurationError -from backend.common.utils.type_conversion_utils import convert_string_to_value +from server.common.config.base_config import BaseConfig +from server.common.errors import ConfigurationError +from server.common.utils.type_conversion_utils import convert_string_to_value class ExternalConfig(BaseConfig): diff --git a/backend/server/common/config/server_config.py b/server/common/config/server_config.py similarity index 94% rename from backend/server/common/config/server_config.py rename to server/common/config/server_config.py index cb1846f1..3023a8ef 100644 --- a/backend/server/common/config/server_config.py +++ b/server/common/config/server_config.py @@ -4,12 +4,12 @@ import warnings from os.path import basename from urllib.parse import urlparse -from backend.server.common.config.base_config import BaseConfig -from backend.server.common.config import DEFAULT_SERVER_PORT, BIG_FILE_SIZE_THRESHOLD -from backend.common.utils.data_locator import discover_s3_region_name -from backend.common.errors import ConfigurationError, DatasetAccessError -from backend.common.utils.utils import is_port_available, find_available_port, custom_format_warning -from backend.server.data_common.matrix_loader import MatrixDataLoader +from server.common.config.base_config import BaseConfig +from server.common.config import DEFAULT_SERVER_PORT, BIG_FILE_SIZE_THRESHOLD +from server.common.utils.data_locator import discover_s3_region_name +from server.common.errors import ConfigurationError, DatasetAccessError +from server.common.utils.utils import is_port_available, find_available_port, custom_format_warning +from server.data_common.matrix_loader import MatrixDataLoader class ServerConfig(BaseConfig): diff --git a/backend/common/constants.py b/server/common/constants.py similarity index 100% rename from backend/common/constants.py rename to server/common/constants.py diff --git a/backend/server/common/corpora.py b/server/common/corpora.py similarity index 95% rename from backend/server/common/corpora.py rename to server/common/corpora.py index 9ab3d587..137eb2a1 100644 --- a/backend/server/common/corpora.py +++ b/server/common/corpora.py @@ -8,8 +8,8 @@ https://github.com/chanzuckerberg/corpora-data-portal/blob/main/backend/schema/c import collections import json -from backend.server.cli.upgrade import validate_version_str -from backend.server.common.utils.corpora_constants import CorporaConstants +from server.cli.upgrade import validate_version_str +from server.common.utils.corpora_constants import CorporaConstants def corpora_get_versions_from_anndata(adata): diff --git a/backend/common/errors.py b/server/common/errors.py similarity index 100% rename from backend/common/errors.py rename to server/common/errors.py diff --git a/backend/common/fbs/NetEncoding/Column.py b/server/common/fbs/NetEncoding/Column.py similarity index 100% rename from backend/common/fbs/NetEncoding/Column.py rename to server/common/fbs/NetEncoding/Column.py diff --git a/backend/common/fbs/NetEncoding/Float32Array.py b/server/common/fbs/NetEncoding/Float32Array.py similarity index 100% rename from backend/common/fbs/NetEncoding/Float32Array.py rename to server/common/fbs/NetEncoding/Float32Array.py diff --git a/backend/common/fbs/NetEncoding/Float64Array.py b/server/common/fbs/NetEncoding/Float64Array.py similarity index 100% rename from backend/common/fbs/NetEncoding/Float64Array.py rename to server/common/fbs/NetEncoding/Float64Array.py diff --git a/backend/common/fbs/NetEncoding/Int32Array.py b/server/common/fbs/NetEncoding/Int32Array.py similarity index 100% rename from backend/common/fbs/NetEncoding/Int32Array.py rename to server/common/fbs/NetEncoding/Int32Array.py diff --git a/backend/common/fbs/NetEncoding/JSONEncodedArray.py b/server/common/fbs/NetEncoding/JSONEncodedArray.py similarity index 100% rename from backend/common/fbs/NetEncoding/JSONEncodedArray.py rename to server/common/fbs/NetEncoding/JSONEncodedArray.py diff --git a/backend/common/fbs/NetEncoding/Matrix.py b/server/common/fbs/NetEncoding/Matrix.py similarity index 100% rename from backend/common/fbs/NetEncoding/Matrix.py rename to server/common/fbs/NetEncoding/Matrix.py diff --git a/backend/common/fbs/NetEncoding/TypedArray.py b/server/common/fbs/NetEncoding/TypedArray.py similarity index 100% rename from backend/common/fbs/NetEncoding/TypedArray.py rename to server/common/fbs/NetEncoding/TypedArray.py diff --git a/backend/common/fbs/NetEncoding/Uint32Array.py b/server/common/fbs/NetEncoding/Uint32Array.py similarity index 100% rename from backend/common/fbs/NetEncoding/Uint32Array.py rename to server/common/fbs/NetEncoding/Uint32Array.py diff --git a/backend/common/utils/__init__.py b/server/common/fbs/NetEncoding/__init__.py similarity index 100% rename from backend/common/utils/__init__.py rename to server/common/fbs/NetEncoding/__init__.py diff --git a/backend/server/app/__init__.py b/server/common/fbs/__init__.py similarity index 100% rename from backend/server/app/__init__.py rename to server/common/fbs/__init__.py diff --git a/backend/common/fbs/matrix.py b/server/common/fbs/matrix.py similarity index 93% rename from backend/common/fbs/matrix.py rename to server/common/fbs/matrix.py index fd8f1cf6..c5349c35 100644 --- a/backend/common/fbs/matrix.py +++ b/server/common/fbs/matrix.py @@ -5,16 +5,16 @@ import pandas as pd from flatbuffers import Builder from scipy import sparse -from backend.common.utils.type_conversion_utils import get_encoding_dtype_of_array +from server.common.utils.type_conversion_utils import get_encoding_dtype_of_array -import backend.common.fbs.NetEncoding.Column as Column -import backend.common.fbs.NetEncoding.Float32Array as Float32Array -import backend.common.fbs.NetEncoding.Float64Array as Float64Array -import backend.common.fbs.NetEncoding.Int32Array as Int32Array -import backend.common.fbs.NetEncoding.JSONEncodedArray as JSONEncodedArray -import backend.common.fbs.NetEncoding.Matrix as Matrix -import backend.common.fbs.NetEncoding.TypedArray as TypedArray -import backend.common.fbs.NetEncoding.Uint32Array as Uint32Array +import server.common.fbs.NetEncoding.Column as Column +import server.common.fbs.NetEncoding.Float32Array as Float32Array +import server.common.fbs.NetEncoding.Float64Array as Float64Array +import server.common.fbs.NetEncoding.Int32Array as Int32Array +import server.common.fbs.NetEncoding.JSONEncodedArray as JSONEncodedArray +import server.common.fbs.NetEncoding.Matrix as Matrix +import server.common.fbs.NetEncoding.TypedArray as TypedArray +import server.common.fbs.NetEncoding.Uint32Array as Uint32Array # Serialization helper diff --git a/backend/common/genesets.py b/server/common/genesets.py similarity index 99% rename from backend/common/genesets.py rename to server/common/genesets.py index cd22b792..35b230df 100644 --- a/backend/common/genesets.py +++ b/server/common/genesets.py @@ -75,7 +75,7 @@ def read_gene_sets_tidycsv(gs_locator, context=None): # if this is the first non-comment row, assume it is a header and validate # column names. OK if the user has extra columns after our initial set. if not haveReadHeader: - if row[0:len(GENESETS_TIDYCSV_HEADER)] != GENESETS_TIDYCSV_HEADER: + if row[0 : len(GENESETS_TIDYCSV_HEADER)] != GENESETS_TIDYCSV_HEADER: raise AnnotationsError("Gene set CSV file missing the required column header.") haveReadHeader = True continue diff --git a/backend/server/common/health.py b/server/common/health.py similarity index 88% rename from backend/server/common/health.py rename to server/common/health.py index 12b7b565..6646066b 100644 --- a/backend/server/common/health.py +++ b/server/common/health.py @@ -1,8 +1,8 @@ from http import HTTPStatus from flask import make_response, jsonify -from backend.server import __version__ as cellxgene_version -from backend.common.utils.data_locator import DataLocator +from server import __version__ as cellxgene_version +from server.common.utils.data_locator import DataLocator def _is_accessible(path, config): diff --git a/backend/server/common/rest.py b/server/common/rest.py similarity index 98% rename from backend/server/common/rest.py rename to server/common/rest.py index bfb3ba2e..e7ff4114 100644 --- a/backend/server/common/rest.py +++ b/server/common/rest.py @@ -8,9 +8,9 @@ import json from flask import make_response, jsonify, current_app, abort from werkzeug.urls import url_unquote -from backend.server.common.config.client_config import get_client_config -from backend.common.constants import Axis, DiffExpMode, JSON_NaN_to_num_warning_msg -from backend.common.errors import ( +from server.common.config.client_config import get_client_config +from server.common.constants import Axis, DiffExpMode, JSON_NaN_to_num_warning_msg +from server.common.errors import ( FilterError, JSONEncodingValueError, PrepareError, @@ -22,8 +22,8 @@ from backend.common.errors import ( ObsoleteRequest, UnsupportedSummaryMethod, ) -from backend.common.genesets import summarizeQueryHash -from backend.common.fbs.matrix import decode_matrix_fbs +from server.common.genesets import summarizeQueryHash +from server.common.fbs.matrix import decode_matrix_fbs def abort_and_log(code, logmsg, loglevel=logging.DEBUG, include_exc_info=False): diff --git a/backend/server/cli/__init__.py b/server/common/utils/__init__.py similarity index 100% rename from backend/server/cli/__init__.py rename to server/common/utils/__init__.py diff --git a/backend/server/common/utils/corpora_constants.py b/server/common/utils/corpora_constants.py similarity index 100% rename from backend/server/common/utils/corpora_constants.py rename to server/common/utils/corpora_constants.py diff --git a/backend/common/utils/data_locator.py b/server/common/utils/data_locator.py similarity index 100% rename from backend/common/utils/data_locator.py rename to server/common/utils/data_locator.py diff --git a/backend/common/utils/type_conversion_utils.py b/server/common/utils/type_conversion_utils.py similarity index 100% rename from backend/common/utils/type_conversion_utils.py rename to server/common/utils/type_conversion_utils.py diff --git a/backend/common/utils/utils.py b/server/common/utils/utils.py similarity index 98% rename from backend/common/utils/utils.py rename to server/common/utils/utils.py index 9eb50aac..9a829c2f 100644 --- a/backend/common/utils/utils.py +++ b/server/common/utils/utils.py @@ -10,7 +10,7 @@ from urllib.parse import urlsplit, urljoin import numpy as np from flask import json -from backend.common.errors import ConfigurationError +from server.common.errors import ConfigurationError def find_available_port(host, port=5005): diff --git a/backend/server/common/__init__.py b/server/common/web/__init__.py similarity index 100% rename from backend/server/common/__init__.py rename to server/common/web/__init__.py diff --git a/backend/server/common/annotations/__init__.py b/server/data_anndata/__init__.py similarity index 100% rename from backend/server/common/annotations/__init__.py rename to server/data_anndata/__init__.py diff --git a/backend/server/data_anndata/anndata_adaptor.py b/server/data_anndata/anndata_adaptor.py similarity index 96% rename from backend/server/data_anndata/anndata_adaptor.py rename to server/data_anndata/anndata_adaptor.py index e229f8e4..de0361ec 100644 --- a/backend/server/data_anndata/anndata_adaptor.py +++ b/server/data_anndata/anndata_adaptor.py @@ -6,15 +6,15 @@ from packaging import version from pandas.core.dtypes.dtypes import CategoricalDtype from scipy import sparse -import backend.common.compute.diffexp_generic as diffexp_generic -import backend.common.compute.estimate_distribution as estimate_distribution -from backend.common.colors import convert_anndata_category_colors_to_cxg_category_colors -from backend.common.constants import Axis, MAX_LAYOUTS, XApproximateDistribution -from backend.server.common.corpora import corpora_get_props_from_anndata -from backend.common.errors import PrepareError, DatasetAccessError -from backend.common.utils.type_conversion_utils import get_schema_type_hint_of_array -from backend.server.data_common.data_adaptor import DataAdaptor -from backend.common.fbs.matrix import encode_matrix_fbs +import server.common.compute.diffexp_generic as diffexp_generic +import server.common.compute.estimate_distribution as estimate_distribution +from server.common.colors import convert_anndata_category_colors_to_cxg_category_colors +from server.common.constants import Axis, MAX_LAYOUTS, XApproximateDistribution +from server.common.corpora import corpora_get_props_from_anndata +from server.common.errors import PrepareError, DatasetAccessError +from server.common.utils.type_conversion_utils import get_schema_type_hint_of_array +from server.data_common.data_adaptor import DataAdaptor +from server.common.fbs.matrix import encode_matrix_fbs anndata_version = version.parse(str(anndata.__version__)).release diff --git a/backend/server/common/utils/__init__.py b/server/data_common/__init__.py similarity index 100% rename from backend/server/common/utils/__init__.py rename to server/data_common/__init__.py diff --git a/backend/server/data_common/data_adaptor.py b/server/data_common/data_adaptor.py similarity index 97% rename from backend/server/data_common/data_adaptor.py rename to server/data_common/data_adaptor.py index 9b85a1e5..550028a4 100644 --- a/backend/server/data_common/data_adaptor.py +++ b/server/data_common/data_adaptor.py @@ -5,12 +5,12 @@ import pandas as pd from scipy import sparse from server_timing import Timing as ServerTiming -from backend.server.common.config.app_config import AppConfig -from backend.common.constants import Axis, XApproximateDistribution -from backend.common.errors import FilterError, JSONEncodingValueError, ExceedsLimitError, UnsupportedSummaryMethod -from backend.common.utils.utils import jsonify_strict -from backend.common.fbs.matrix import encode_matrix_fbs -from backend.common.genesets import validate_gene_sets +from server.common.config.app_config import AppConfig +from server.common.constants import Axis, XApproximateDistribution +from server.common.errors import FilterError, JSONEncodingValueError, ExceedsLimitError, UnsupportedSummaryMethod +from server.common.utils.utils import jsonify_strict +from server.common.fbs.matrix import encode_matrix_fbs +from server.common.genesets import validate_gene_sets class DataAdaptor(metaclass=ABCMeta): diff --git a/backend/server/data_common/matrix_loader.py b/server/data_common/matrix_loader.py similarity index 91% rename from backend/server/data_common/matrix_loader.py rename to server/data_common/matrix_loader.py index c032d39c..1db1225d 100644 --- a/backend/server/data_common/matrix_loader.py +++ b/server/data_common/matrix_loader.py @@ -1,7 +1,7 @@ from enum import Enum -from backend.common.utils.data_locator import DataLocator -from backend.common.errors import DatasetAccessError +from server.common.utils.data_locator import DataLocator +from server.common.errors import DatasetAccessError from http import HTTPStatus @@ -30,7 +30,7 @@ class MatrixDataLoader(object): raise DatasetAccessError("Dataset does not have an allowed type.") if self.matrix_data_type == MatrixDataType.H5AD: - from backend.server.data_anndata.anndata_adaptor import AnndataAdaptor + from server.data_anndata.anndata_adaptor import AnndataAdaptor self.matrix_type = AnndataAdaptor diff --git a/backend/server/default_config.py b/server/default_config.py similarity index 100% rename from backend/server/default_config.py rename to server/default_config.py diff --git a/backend/server/requirements-dev.txt b/server/requirements-dev.txt similarity index 100% rename from backend/server/requirements-dev.txt rename to server/requirements-dev.txt diff --git a/backend/server/requirements-prepare.txt b/server/requirements-prepare.txt similarity index 100% rename from backend/server/requirements-prepare.txt rename to server/requirements-prepare.txt diff --git a/backend/server/requirements.txt b/server/requirements.txt similarity index 100% rename from backend/server/requirements.txt rename to server/requirements.txt diff --git a/setup.cfg b/setup.cfg index 7913312c..37bf9c86 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,4 +1,4 @@ [flake8] max-line-length = 120 ignore = E203, W503 -exclude = backend/common/fbs/NetEncoding/,.git,__pycache__,venv,old,build,dist +exclude = server/common/fbs/NetEncoding/,.git,__pycache__,venv,old,build,dist diff --git a/setup.py b/setup.py index 4228afcd..6824993e 100644 --- a/setup.py +++ b/setup.py @@ -3,10 +3,10 @@ from setuptools import setup, find_packages with open("README.md", "rb") as fh: long_description = fh.read().decode() -with open("backend/server/requirements.txt") as fh: +with open("server/requirements.txt") as fh: requirements = fh.read().splitlines() -with open("backend/server/requirements-prepare.txt") as fh: +with open("server/requirements-prepare.txt") as fh: requirements_prepare = fh.read().splitlines() setup( @@ -39,6 +39,6 @@ setup( "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering :: Bio-Informatics", ], - entry_points={"console_scripts": ["cellxgene = backend.server.cli.cli:cli"]}, + entry_points={"console_scripts": ["cellxgene = server.cli.cli:cli"]}, extras_require=dict(prepare=requirements_prepare), ) diff --git a/backend/test/__init__.py b/test/__init__.py similarity index 82% rename from backend/test/__init__.py rename to test/__init__.py index b0ebff21..3664bc3c 100644 --- a/backend/test/__init__.py +++ b/test/__init__.py @@ -3,7 +3,7 @@ import string from os import popen PROJECT_ROOT = popen("git rev-parse --show-toplevel").read().strip() -FIXTURES_ROOT = PROJECT_ROOT + "/backend/test/fixtures" +FIXTURES_ROOT = PROJECT_ROOT + "/test/fixtures" H5AD_FIXTURE = FIXTURES_ROOT + "/pbmc3k-CSC-gz.h5ad" diff --git a/backend/test/decode_fbs.py b/test/decode_fbs.py similarity index 88% rename from backend/test/decode_fbs.py rename to test/decode_fbs.py index e6953a49..e0573238 100644 --- a/backend/test/decode_fbs.py +++ b/test/decode_fbs.py @@ -5,8 +5,8 @@ This code will need to be updated if fbs/matrix.fbs changes. For more informatio server/data_common/fbs/ """ -import backend.common.fbs.NetEncoding.Matrix as Matrix -from backend.common.fbs.matrix import deserialize_typed_array +import server.common.fbs.NetEncoding.Matrix as Matrix +from server.common.fbs.matrix import deserialize_typed_array def decode_matrix_FBS(buf): diff --git a/backend/test/fixtures/1e4dfec4-c0b2-46ad-a04e-ff3ffb3c0a8f.h5ad b/test/fixtures/1e4dfec4-c0b2-46ad-a04e-ff3ffb3c0a8f.h5ad similarity index 100% rename from backend/test/fixtures/1e4dfec4-c0b2-46ad-a04e-ff3ffb3c0a8f.h5ad rename to test/fixtures/1e4dfec4-c0b2-46ad-a04e-ff3ffb3c0a8f.h5ad diff --git a/backend/server/common/web/__init__.py b/test/fixtures/__init__.py similarity index 100% rename from backend/server/common/web/__init__.py rename to test/fixtures/__init__.py diff --git a/backend/test/fixtures/a95c59b4-7f5d-4b80-ad53-a694834ca18b.h5ad b/test/fixtures/a95c59b4-7f5d-4b80-ad53-a694834ca18b.h5ad similarity index 100% rename from backend/test/fixtures/a95c59b4-7f5d-4b80-ad53-a694834ca18b.h5ad rename to test/fixtures/a95c59b4-7f5d-4b80-ad53-a694834ca18b.h5ad diff --git a/backend/test/fixtures/dataset_config_outline.py b/test/fixtures/dataset_config_outline.py similarity index 100% rename from backend/test/fixtures/dataset_config_outline.py rename to test/fixtures/dataset_config_outline.py diff --git a/backend/test/fixtures/fixtures.py b/test/fixtures/fixtures.py similarity index 100% rename from backend/test/fixtures/fixtures.py rename to test/fixtures/fixtures.py diff --git a/backend/test/fixtures/hgnc_example.txt.gz b/test/fixtures/hgnc_example.txt.gz similarity index 100% rename from backend/test/fixtures/hgnc_example.txt.gz rename to test/fixtures/hgnc_example.txt.gz diff --git a/backend/test/fixtures/nan.h5ad b/test/fixtures/nan.h5ad similarity index 100% rename from backend/test/fixtures/nan.h5ad rename to test/fixtures/nan.h5ad diff --git a/backend/test/fixtures/pbmc3k-CSC-gz.h5ad b/test/fixtures/pbmc3k-CSC-gz.h5ad similarity index 100% rename from backend/test/fixtures/pbmc3k-CSC-gz.h5ad rename to test/fixtures/pbmc3k-CSC-gz.h5ad diff --git a/backend/test/fixtures/pbmc3k-CSR-gz.h5ad b/test/fixtures/pbmc3k-CSR-gz.h5ad similarity index 100% rename from backend/test/fixtures/pbmc3k-CSR-gz.h5ad rename to test/fixtures/pbmc3k-CSR-gz.h5ad diff --git a/backend/test/fixtures/pbmc3k-annotations.csv b/test/fixtures/pbmc3k-annotations.csv similarity index 100% rename from backend/test/fixtures/pbmc3k-annotations.csv rename to test/fixtures/pbmc3k-annotations.csv diff --git a/backend/test/fixtures/pbmc3k-genesets.csv b/test/fixtures/pbmc3k-genesets.csv similarity index 100% rename from backend/test/fixtures/pbmc3k-genesets.csv rename to test/fixtures/pbmc3k-genesets.csv diff --git a/backend/test/fixtures/pbmc3k.cxg/X/__1587182255882_1587182255882_f7aa6ccb49a944f9ab9e25b11bbfab4f/__attr.tdb b/test/fixtures/pbmc3k.cxg/X/__1587182255882_1587182255882_f7aa6ccb49a944f9ab9e25b11bbfab4f/__attr.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/X/__1587182255882_1587182255882_f7aa6ccb49a944f9ab9e25b11bbfab4f/__attr.tdb rename to test/fixtures/pbmc3k.cxg/X/__1587182255882_1587182255882_f7aa6ccb49a944f9ab9e25b11bbfab4f/__attr.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/X/__1587182255882_1587182255882_f7aa6ccb49a944f9ab9e25b11bbfab4f/__fragment_metadata.tdb b/test/fixtures/pbmc3k.cxg/X/__1587182255882_1587182255882_f7aa6ccb49a944f9ab9e25b11bbfab4f/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/X/__1587182255882_1587182255882_f7aa6ccb49a944f9ab9e25b11bbfab4f/__fragment_metadata.tdb rename to test/fixtures/pbmc3k.cxg/X/__1587182255882_1587182255882_f7aa6ccb49a944f9ab9e25b11bbfab4f/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/X/__array_schema.tdb b/test/fixtures/pbmc3k.cxg/X/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/X/__array_schema.tdb rename to test/fixtures/pbmc3k.cxg/X/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/X/__lock.tdb b/test/fixtures/pbmc3k.cxg/X/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/X/__lock.tdb rename to test/fixtures/pbmc3k.cxg/X/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/__tiledb_group.tdb b/test/fixtures/pbmc3k.cxg/__tiledb_group.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/__tiledb_group.tdb rename to test/fixtures/pbmc3k.cxg/__tiledb_group.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__1587182255763_1587182255763_88cd3d13926f4892af7230837bcc5178/__attr.tdb b/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__1587182255763_1587182255763_88cd3d13926f4892af7230837bcc5178/__attr.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__1587182255763_1587182255763_88cd3d13926f4892af7230837bcc5178/__attr.tdb rename to test/fixtures/pbmc3k.cxg/cxg_group_metadata/__1587182255763_1587182255763_88cd3d13926f4892af7230837bcc5178/__attr.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__1587182255763_1587182255763_88cd3d13926f4892af7230837bcc5178/__fragment_metadata.tdb b/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__1587182255763_1587182255763_88cd3d13926f4892af7230837bcc5178/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__1587182255763_1587182255763_88cd3d13926f4892af7230837bcc5178/__fragment_metadata.tdb rename to test/fixtures/pbmc3k.cxg/cxg_group_metadata/__1587182255763_1587182255763_88cd3d13926f4892af7230837bcc5178/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__array_schema.tdb b/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__array_schema.tdb rename to test/fixtures/pbmc3k.cxg/cxg_group_metadata/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__lock.tdb b/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__lock.tdb rename to test/fixtures/pbmc3k.cxg/cxg_group_metadata/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__meta/__1587182255768_1587182255768_fa7617ae99f843929911e4bc7b03e3db b/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__meta/__1587182255768_1587182255768_fa7617ae99f843929911e4bc7b03e3db similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/cxg_group_metadata/__meta/__1587182255768_1587182255768_fa7617ae99f843929911e4bc7b03e3db rename to test/fixtures/pbmc3k.cxg/cxg_group_metadata/__meta/__1587182255768_1587182255768_fa7617ae99f843929911e4bc7b03e3db diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/__tiledb_group.tdb b/test/fixtures/pbmc3k.cxg/emb/__tiledb_group.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/__tiledb_group.tdb rename to test/fixtures/pbmc3k.cxg/emb/__tiledb_group.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__1587182255875_1587182255875_e02a92b5d18f45e0a02031568f4633d4/__attr.tdb b/test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__1587182255875_1587182255875_e02a92b5d18f45e0a02031568f4633d4/__attr.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__1587182255875_1587182255875_e02a92b5d18f45e0a02031568f4633d4/__attr.tdb rename to test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__1587182255875_1587182255875_e02a92b5d18f45e0a02031568f4633d4/__attr.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__1587182255875_1587182255875_e02a92b5d18f45e0a02031568f4633d4/__fragment_metadata.tdb b/test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__1587182255875_1587182255875_e02a92b5d18f45e0a02031568f4633d4/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__1587182255875_1587182255875_e02a92b5d18f45e0a02031568f4633d4/__fragment_metadata.tdb rename to test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__1587182255875_1587182255875_e02a92b5d18f45e0a02031568f4633d4/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__array_schema.tdb b/test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__array_schema.tdb rename to test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__lock.tdb b/test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__lock.tdb rename to test/fixtures/pbmc3k.cxg/emb/draw_graph_fr/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/pca/__1587182255827_1587182255827_8aeb4df5c2a74918b7aeeb6d34632e24/__attr.tdb b/test/fixtures/pbmc3k.cxg/emb/pca/__1587182255827_1587182255827_8aeb4df5c2a74918b7aeeb6d34632e24/__attr.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/pca/__1587182255827_1587182255827_8aeb4df5c2a74918b7aeeb6d34632e24/__attr.tdb rename to test/fixtures/pbmc3k.cxg/emb/pca/__1587182255827_1587182255827_8aeb4df5c2a74918b7aeeb6d34632e24/__attr.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/pca/__1587182255827_1587182255827_8aeb4df5c2a74918b7aeeb6d34632e24/__fragment_metadata.tdb b/test/fixtures/pbmc3k.cxg/emb/pca/__1587182255827_1587182255827_8aeb4df5c2a74918b7aeeb6d34632e24/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/pca/__1587182255827_1587182255827_8aeb4df5c2a74918b7aeeb6d34632e24/__fragment_metadata.tdb rename to test/fixtures/pbmc3k.cxg/emb/pca/__1587182255827_1587182255827_8aeb4df5c2a74918b7aeeb6d34632e24/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/pca/__array_schema.tdb b/test/fixtures/pbmc3k.cxg/emb/pca/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/pca/__array_schema.tdb rename to test/fixtures/pbmc3k.cxg/emb/pca/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/pca/__lock.tdb b/test/fixtures/pbmc3k.cxg/emb/pca/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/pca/__lock.tdb rename to test/fixtures/pbmc3k.cxg/emb/pca/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/tsne/__1587182255846_1587182255846_0b832c3ed3534b458e83c75726f2005f/__attr.tdb b/test/fixtures/pbmc3k.cxg/emb/tsne/__1587182255846_1587182255846_0b832c3ed3534b458e83c75726f2005f/__attr.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/tsne/__1587182255846_1587182255846_0b832c3ed3534b458e83c75726f2005f/__attr.tdb rename to test/fixtures/pbmc3k.cxg/emb/tsne/__1587182255846_1587182255846_0b832c3ed3534b458e83c75726f2005f/__attr.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/tsne/__1587182255846_1587182255846_0b832c3ed3534b458e83c75726f2005f/__fragment_metadata.tdb b/test/fixtures/pbmc3k.cxg/emb/tsne/__1587182255846_1587182255846_0b832c3ed3534b458e83c75726f2005f/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/tsne/__1587182255846_1587182255846_0b832c3ed3534b458e83c75726f2005f/__fragment_metadata.tdb rename to test/fixtures/pbmc3k.cxg/emb/tsne/__1587182255846_1587182255846_0b832c3ed3534b458e83c75726f2005f/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/tsne/__array_schema.tdb b/test/fixtures/pbmc3k.cxg/emb/tsne/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/tsne/__array_schema.tdb rename to test/fixtures/pbmc3k.cxg/emb/tsne/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/tsne/__lock.tdb b/test/fixtures/pbmc3k.cxg/emb/tsne/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/tsne/__lock.tdb rename to test/fixtures/pbmc3k.cxg/emb/tsne/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/umap/__1587182255867_1587182255867_44955ba2220c4ad59bbdbb6b26e21428/__attr.tdb b/test/fixtures/pbmc3k.cxg/emb/umap/__1587182255867_1587182255867_44955ba2220c4ad59bbdbb6b26e21428/__attr.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/umap/__1587182255867_1587182255867_44955ba2220c4ad59bbdbb6b26e21428/__attr.tdb rename to test/fixtures/pbmc3k.cxg/emb/umap/__1587182255867_1587182255867_44955ba2220c4ad59bbdbb6b26e21428/__attr.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/umap/__1587182255867_1587182255867_44955ba2220c4ad59bbdbb6b26e21428/__fragment_metadata.tdb b/test/fixtures/pbmc3k.cxg/emb/umap/__1587182255867_1587182255867_44955ba2220c4ad59bbdbb6b26e21428/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/umap/__1587182255867_1587182255867_44955ba2220c4ad59bbdbb6b26e21428/__fragment_metadata.tdb rename to test/fixtures/pbmc3k.cxg/emb/umap/__1587182255867_1587182255867_44955ba2220c4ad59bbdbb6b26e21428/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/umap/__array_schema.tdb b/test/fixtures/pbmc3k.cxg/emb/umap/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/umap/__array_schema.tdb rename to test/fixtures/pbmc3k.cxg/emb/umap/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/emb/umap/__lock.tdb b/test/fixtures/pbmc3k.cxg/emb/umap/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/emb/umap/__lock.tdb rename to test/fixtures/pbmc3k.cxg/emb/umap/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/__fragment_metadata.tdb b/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/__fragment_metadata.tdb rename to test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/louvain.tdb b/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/louvain.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/louvain.tdb rename to test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/louvain.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/louvain_var.tdb b/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/louvain_var.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/louvain_var.tdb rename to test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/louvain_var.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/n_counts.tdb b/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/n_counts.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/n_counts.tdb rename to test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/n_counts.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/n_genes.tdb b/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/n_genes.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/n_genes.tdb rename to test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/n_genes.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/name_0.tdb b/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/name_0.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/name_0.tdb rename to test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/name_0.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/name_0_var.tdb b/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/name_0_var.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/name_0_var.tdb rename to test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/name_0_var.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/percent_mito.tdb b/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/percent_mito.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/percent_mito.tdb rename to test/fixtures/pbmc3k.cxg/obs/__1587182255797_1587182255797_d3d57575169a48eaa00d2f709d0a534c/percent_mito.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/obs/__array_schema.tdb b/test/fixtures/pbmc3k.cxg/obs/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/obs/__array_schema.tdb rename to test/fixtures/pbmc3k.cxg/obs/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/obs/__lock.tdb b/test/fixtures/pbmc3k.cxg/obs/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/obs/__lock.tdb rename to test/fixtures/pbmc3k.cxg/obs/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/obs/__meta/__1587182255787_1587182255787_e19a340576a340db85c37b61b83dbe57 b/test/fixtures/pbmc3k.cxg/obs/__meta/__1587182255787_1587182255787_e19a340576a340db85c37b61b83dbe57 similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/obs/__meta/__1587182255787_1587182255787_e19a340576a340db85c37b61b83dbe57 rename to test/fixtures/pbmc3k.cxg/obs/__meta/__1587182255787_1587182255787_e19a340576a340db85c37b61b83dbe57 diff --git a/backend/test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/__fragment_metadata.tdb b/test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/__fragment_metadata.tdb rename to test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/n_cells.tdb b/test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/n_cells.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/n_cells.tdb rename to test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/n_cells.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/name_0.tdb b/test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/name_0.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/name_0.tdb rename to test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/name_0.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/name_0_var.tdb b/test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/name_0_var.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/name_0_var.tdb rename to test/fixtures/pbmc3k.cxg/var/__1587182255773_1587182255773_12e07b1585a64ebe9d40098d67a8e8ad/name_0_var.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/var/__array_schema.tdb b/test/fixtures/pbmc3k.cxg/var/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/var/__array_schema.tdb rename to test/fixtures/pbmc3k.cxg/var/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/var/__lock.tdb b/test/fixtures/pbmc3k.cxg/var/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/var/__lock.tdb rename to test/fixtures/pbmc3k.cxg/var/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k.cxg/var/__meta/__1587182255771_1587182255771_5a3a50f0b360403eab0e427c429f574e b/test/fixtures/pbmc3k.cxg/var/__meta/__1587182255771_1587182255771_5a3a50f0b360403eab0e427c429f574e similarity index 100% rename from backend/test/fixtures/pbmc3k.cxg/var/__meta/__1587182255771_1587182255771_5a3a50f0b360403eab0e427c429f574e rename to test/fixtures/pbmc3k.cxg/var/__meta/__1587182255771_1587182255771_5a3a50f0b360403eab0e427c429f574e diff --git a/backend/test/fixtures/pbmc3k_64.h5ad b/test/fixtures/pbmc3k_64.h5ad similarity index 100% rename from backend/test/fixtures/pbmc3k_64.h5ad rename to test/fixtures/pbmc3k_64.h5ad diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/X/__1576858534264_1576858534264_4f12045b32ea45a490bdad087bac4dc3/__attr.tdb b/test/fixtures/pbmc3k_v0.cxg/X/__1576858534264_1576858534264_4f12045b32ea45a490bdad087bac4dc3/__attr.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/X/__1576858534264_1576858534264_4f12045b32ea45a490bdad087bac4dc3/__attr.tdb rename to test/fixtures/pbmc3k_v0.cxg/X/__1576858534264_1576858534264_4f12045b32ea45a490bdad087bac4dc3/__attr.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/X/__1576858534264_1576858534264_4f12045b32ea45a490bdad087bac4dc3/__fragment_metadata.tdb b/test/fixtures/pbmc3k_v0.cxg/X/__1576858534264_1576858534264_4f12045b32ea45a490bdad087bac4dc3/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/X/__1576858534264_1576858534264_4f12045b32ea45a490bdad087bac4dc3/__fragment_metadata.tdb rename to test/fixtures/pbmc3k_v0.cxg/X/__1576858534264_1576858534264_4f12045b32ea45a490bdad087bac4dc3/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/X/__array_schema.tdb b/test/fixtures/pbmc3k_v0.cxg/X/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/X/__array_schema.tdb rename to test/fixtures/pbmc3k_v0.cxg/X/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/X/__lock.tdb b/test/fixtures/pbmc3k_v0.cxg/X/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/X/__lock.tdb rename to test/fixtures/pbmc3k_v0.cxg/X/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/__tiledb_group.tdb b/test/fixtures/pbmc3k_v0.cxg/__tiledb_group.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/__tiledb_group.tdb rename to test/fixtures/pbmc3k_v0.cxg/__tiledb_group.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/__tiledb_group.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/__tiledb_group.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/__tiledb_group.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/__tiledb_group.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__1576858534229_1576858534229_391cdd6b87b649dea76842dfa59ed0d9/__attr.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__1576858534229_1576858534229_391cdd6b87b649dea76842dfa59ed0d9/__attr.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__1576858534229_1576858534229_391cdd6b87b649dea76842dfa59ed0d9/__attr.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__1576858534229_1576858534229_391cdd6b87b649dea76842dfa59ed0d9/__attr.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__1576858534229_1576858534229_391cdd6b87b649dea76842dfa59ed0d9/__fragment_metadata.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__1576858534229_1576858534229_391cdd6b87b649dea76842dfa59ed0d9/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__1576858534229_1576858534229_391cdd6b87b649dea76842dfa59ed0d9/__fragment_metadata.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__1576858534229_1576858534229_391cdd6b87b649dea76842dfa59ed0d9/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__array_schema.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__array_schema.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__lock.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__lock.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/draw_graph_fr/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/pca/__1576858534121_1576858534121_454903804a694b3b8ccdae56065664ba/__attr.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/pca/__1576858534121_1576858534121_454903804a694b3b8ccdae56065664ba/__attr.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/pca/__1576858534121_1576858534121_454903804a694b3b8ccdae56065664ba/__attr.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/pca/__1576858534121_1576858534121_454903804a694b3b8ccdae56065664ba/__attr.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/pca/__1576858534121_1576858534121_454903804a694b3b8ccdae56065664ba/__fragment_metadata.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/pca/__1576858534121_1576858534121_454903804a694b3b8ccdae56065664ba/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/pca/__1576858534121_1576858534121_454903804a694b3b8ccdae56065664ba/__fragment_metadata.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/pca/__1576858534121_1576858534121_454903804a694b3b8ccdae56065664ba/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/pca/__array_schema.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/pca/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/pca/__array_schema.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/pca/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/pca/__lock.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/pca/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/pca/__lock.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/pca/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/tsne/__1576858534161_1576858534161_aa4803e7e7be4b23bea35f5d62296f14/__attr.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/tsne/__1576858534161_1576858534161_aa4803e7e7be4b23bea35f5d62296f14/__attr.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/tsne/__1576858534161_1576858534161_aa4803e7e7be4b23bea35f5d62296f14/__attr.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/tsne/__1576858534161_1576858534161_aa4803e7e7be4b23bea35f5d62296f14/__attr.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/tsne/__1576858534161_1576858534161_aa4803e7e7be4b23bea35f5d62296f14/__fragment_metadata.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/tsne/__1576858534161_1576858534161_aa4803e7e7be4b23bea35f5d62296f14/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/tsne/__1576858534161_1576858534161_aa4803e7e7be4b23bea35f5d62296f14/__fragment_metadata.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/tsne/__1576858534161_1576858534161_aa4803e7e7be4b23bea35f5d62296f14/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/tsne/__array_schema.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/tsne/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/tsne/__array_schema.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/tsne/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/tsne/__lock.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/tsne/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/tsne/__lock.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/tsne/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/umap/__1576858534193_1576858534193_67d97bcdd3d1486985f5974b133cb496/__attr.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/umap/__1576858534193_1576858534193_67d97bcdd3d1486985f5974b133cb496/__attr.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/umap/__1576858534193_1576858534193_67d97bcdd3d1486985f5974b133cb496/__attr.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/umap/__1576858534193_1576858534193_67d97bcdd3d1486985f5974b133cb496/__attr.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/umap/__1576858534193_1576858534193_67d97bcdd3d1486985f5974b133cb496/__fragment_metadata.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/umap/__1576858534193_1576858534193_67d97bcdd3d1486985f5974b133cb496/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/umap/__1576858534193_1576858534193_67d97bcdd3d1486985f5974b133cb496/__fragment_metadata.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/umap/__1576858534193_1576858534193_67d97bcdd3d1486985f5974b133cb496/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/umap/__array_schema.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/umap/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/umap/__array_schema.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/umap/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/emb/umap/__lock.tdb b/test/fixtures/pbmc3k_v0.cxg/emb/umap/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/emb/umap/__lock.tdb rename to test/fixtures/pbmc3k_v0.cxg/emb/umap/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/__fragment_metadata.tdb b/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/__fragment_metadata.tdb rename to test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/louvain.tdb b/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/louvain.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/louvain.tdb rename to test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/louvain.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/louvain_var.tdb b/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/louvain_var.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/louvain_var.tdb rename to test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/louvain_var.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/n_counts.tdb b/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/n_counts.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/n_counts.tdb rename to test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/n_counts.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/n_genes.tdb b/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/n_genes.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/n_genes.tdb rename to test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/n_genes.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/name_0.tdb b/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/name_0.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/name_0.tdb rename to test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/name_0.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/name_0_var.tdb b/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/name_0_var.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/name_0_var.tdb rename to test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/name_0_var.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/percent_mito.tdb b/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/percent_mito.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/percent_mito.tdb rename to test/fixtures/pbmc3k_v0.cxg/obs/__1576858534031_1576858534031_1641d0129fe64c78b2d0a6a684ce47ba/percent_mito.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/obs/__array_schema.tdb b/test/fixtures/pbmc3k_v0.cxg/obs/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/obs/__array_schema.tdb rename to test/fixtures/pbmc3k_v0.cxg/obs/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/obs/__lock.tdb b/test/fixtures/pbmc3k_v0.cxg/obs/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/obs/__lock.tdb rename to test/fixtures/pbmc3k_v0.cxg/obs/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/obs/__meta/__1576858534024_1576858534024_e856aef5b0e244b1a4b7dde70cd864d0 b/test/fixtures/pbmc3k_v0.cxg/obs/__meta/__1576858534024_1576858534024_e856aef5b0e244b1a4b7dde70cd864d0 similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/obs/__meta/__1576858534024_1576858534024_e856aef5b0e244b1a4b7dde70cd864d0 rename to test/fixtures/pbmc3k_v0.cxg/obs/__meta/__1576858534024_1576858534024_e856aef5b0e244b1a4b7dde70cd864d0 diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/__fragment_metadata.tdb b/test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/__fragment_metadata.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/__fragment_metadata.tdb rename to test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/__fragment_metadata.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/n_cells.tdb b/test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/n_cells.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/n_cells.tdb rename to test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/n_cells.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/name_0.tdb b/test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/name_0.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/name_0.tdb rename to test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/name_0.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/name_0_var.tdb b/test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/name_0_var.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/name_0_var.tdb rename to test/fixtures/pbmc3k_v0.cxg/var/__1576858533970_1576858533970_d241b2e750eb425a9ee23ed1de686c2a/name_0_var.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/var/__array_schema.tdb b/test/fixtures/pbmc3k_v0.cxg/var/__array_schema.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/var/__array_schema.tdb rename to test/fixtures/pbmc3k_v0.cxg/var/__array_schema.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/var/__lock.tdb b/test/fixtures/pbmc3k_v0.cxg/var/__lock.tdb similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/var/__lock.tdb rename to test/fixtures/pbmc3k_v0.cxg/var/__lock.tdb diff --git a/backend/test/fixtures/pbmc3k_v0.cxg/var/__meta/__1576858533966_1576858533966_1362646d804b4982b35052a367633436 b/test/fixtures/pbmc3k_v0.cxg/var/__meta/__1576858533966_1576858533966_1362646d804b4982b35052a367633436 similarity index 100% rename from backend/test/fixtures/pbmc3k_v0.cxg/var/__meta/__1576858533966_1576858533966_1362646d804b4982b35052a367633436 rename to test/fixtures/pbmc3k_v0.cxg/var/__meta/__1576858533966_1576858533966_1362646d804b4982b35052a367633436 diff --git a/backend/test/fixtures/schema.json b/test/fixtures/schema.json similarity index 100% rename from backend/test/fixtures/schema.json rename to test/fixtures/schema.json diff --git a/backend/test/fixtures/server_config_outline.py b/test/fixtures/server_config_outline.py similarity index 100% rename from backend/test/fixtures/server_config_outline.py rename to test/fixtures/server_config_outline.py diff --git a/backend/test/fixtures/test_bad_config.yaml b/test/fixtures/test_bad_config.yaml similarity index 100% rename from backend/test/fixtures/test_bad_config.yaml rename to test/fixtures/test_bad_config.yaml diff --git a/backend/test/fixtures/test_config.yaml b/test/fixtures/test_config.yaml similarity index 100% rename from backend/test/fixtures/test_config.yaml rename to test/fixtures/test_config.yaml diff --git a/backend/server/compute/__init__.py b/test/performance/__init__.py similarity index 100% rename from backend/server/compute/__init__.py rename to test/performance/__init__.py diff --git a/backend/test/test_server/performance/create_test_matrix.py b/test/performance/create_test_matrix.py similarity index 100% rename from backend/test/test_server/performance/create_test_matrix.py rename to test/performance/create_test_matrix.py diff --git a/backend/test/test_server/performance/run_diffexp.py b/test/performance/run_diffexp.py similarity index 90% rename from backend/test/test_server/performance/run_diffexp.py rename to test/performance/run_diffexp.py index 9475fac4..f99ff012 100644 --- a/backend/test/test_server/performance/run_diffexp.py +++ b/test/performance/run_diffexp.py @@ -4,10 +4,10 @@ import random import time import numpy as np -import backend.common.compute.diffexp_generic as diffexp_generic +import server.common.compute.diffexp_generic as diffexp_generic -from backend.server.common.config.app_config import AppConfig -from backend.server.data_common.matrix_loader import MatrixDataLoader +from server.common.config.app_config import AppConfig +from server.data_common.matrix_loader import MatrixDataLoader def main(): @@ -18,9 +18,7 @@ def main(): parser.add_argument("-va", "--varA", help="obs variable:value to use for group A") parser.add_argument("-vb", "--varB", help="obs variable:value to use for group B") parser.add_argument("-t", "--trials", default=1, type=int, help="number of trials") - parser.add_argument( - "-a", "--alg", choices=("default", "generic"), default="default", help="algorithm to use" - ) + parser.add_argument("-a", "--alg", choices=("default", "generic"), default="default", help="algorithm to use") parser.add_argument("-s", "--show", default=False, action="store_true", help="show the results") parser.add_argument( "-n", "--new-selection", default=False, action="store_true", help="change the selection between each trial" diff --git a/backend/test/test_server/unit/__init__.py b/test/unit/__init__.py similarity index 86% rename from backend/test/test_server/unit/__init__.py rename to test/unit/__init__.py index fe7d2b6b..31090014 100644 --- a/backend/test/test_server/unit/__init__.py +++ b/test/unit/__init__.py @@ -4,27 +4,27 @@ import shutil import tempfile import time from contextlib import contextmanager -from os import path, popen +from os import path from subprocess import Popen import pandas as pd import requests -from backend.server.common.annotations.local_file_csv import AnnotationsLocalFile -from backend.server.common.config.app_config import AppConfig -from backend.server.common.config import DEFAULT_SERVER_PORT -from backend.common.utils.data_locator import DataLocator -from backend.common.utils.utils import find_available_port -from backend.common.fbs.matrix import encode_matrix_fbs -from backend.server.data_common.matrix_loader import MatrixDataType, MatrixDataLoader -from backend.test import PROJECT_ROOT +from server.common.annotations.local_file_csv import AnnotationsLocalFile +from server.common.config import DEFAULT_SERVER_PORT +from server.common.config.app_config import AppConfig +from server.common.fbs.matrix import encode_matrix_fbs +from server.common.utils.data_locator import DataLocator +from server.common.utils.utils import find_available_port +from server.data_common.matrix_loader import MatrixDataType, MatrixDataLoader +from test import PROJECT_ROOT def data_with_tmp_annotations(ext: MatrixDataType, annotations_fixture=False): tmp_dir = tempfile.mkdtemp() annotations_file = path.join(tmp_dir, "test_annotations.csv") if annotations_fixture: - shutil.copyfile(f"{PROJECT_ROOT}/backend/test/fixtures/pbmc3k-annotations.csv", annotations_file) + shutil.copyfile(f"{PROJECT_ROOT}/test/fixtures/pbmc3k-annotations.csv", annotations_file) fname = { MatrixDataType.H5AD: f"{PROJECT_ROOT}/example-dataset/pbmc3k.h5ad", }[ext] @@ -37,7 +37,9 @@ def data_with_tmp_annotations(ext: MatrixDataType, annotations_fixture=False): single_dataset__datapath=data_locator.path, ) config.update_dataset_config( - embeddings__names=["umap"], presentation__max_categories=100, diffexp__lfc_cutoff=0.01, + embeddings__names=["umap"], + presentation__max_categories=100, + diffexp__lfc_cutoff=0.01, ) config.complete_config() diff --git a/backend/server/data_anndata/__init__.py b/test/unit/cli/__init__.py similarity index 100% rename from backend/server/data_anndata/__init__.py rename to test/unit/cli/__init__.py diff --git a/backend/test/test_server/unit/cli/test_launch.py b/test/unit/cli/test_launch.py similarity index 88% rename from backend/test/test_server/unit/cli/test_launch.py rename to test/unit/cli/test_launch.py index b799bf55..74da66ee 100644 --- a/backend/test/test_server/unit/cli/test_launch.py +++ b/test/unit/cli/test_launch.py @@ -5,8 +5,8 @@ import unittest import yaml -from backend.server.default_config import default_config -from backend.test import FIXTURES_ROOT +from server.default_config import default_config +from test import FIXTURES_ROOT class CLIPLaunchTests(unittest.TestCase): diff --git a/backend/test/test_server/unit/cli/test_prepare.py b/test/unit/cli/test_prepare.py similarity index 88% rename from backend/test/test_server/unit/cli/test_prepare.py rename to test/unit/cli/test_prepare.py index 517bed54..81b83244 100644 --- a/backend/test/test_server/unit/cli/test_prepare.py +++ b/test/unit/cli/test_prepare.py @@ -2,7 +2,7 @@ import unittest import pandas as pd -from backend.server.cli.prepare import make_index_unique +from server.cli.prepare import make_index_unique class CLIPrepareTests(unittest.TestCase): diff --git a/backend/test/test_server/unit/cli/test_upgrade.py b/test/unit/cli/test_upgrade.py similarity index 92% rename from backend/test/test_server/unit/cli/test_upgrade.py rename to test/unit/cli/test_upgrade.py index d4ebb352..c3c93e17 100644 --- a/backend/test/test_server/unit/cli/test_upgrade.py +++ b/test/unit/cli/test_upgrade.py @@ -1,6 +1,6 @@ import unittest -from backend.server.cli.upgrade import validate_version_str, split_version, version_gt +from server.cli.upgrade import validate_version_str, split_version, version_gt class CLIUpgradeTests(unittest.TestCase): diff --git a/backend/server/data_common/__init__.py b/test/unit/common/__init__.py similarity index 100% rename from backend/server/data_common/__init__.py rename to test/unit/common/__init__.py diff --git a/backend/test/test_server/unit/common/config/__init__.py b/test/unit/common/config/__init__.py similarity index 99% rename from backend/test/test_server/unit/common/config/__init__.py rename to test/unit/common/config/__init__.py index e6e4f22a..0e8046a8 100644 --- a/backend/test/test_server/unit/common/config/__init__.py +++ b/test/unit/common/config/__init__.py @@ -5,7 +5,7 @@ import random from unittest import mock import yaml -from backend.test import FIXTURES_ROOT +from test import FIXTURES_ROOT def mockenv(**envvars): diff --git a/backend/test/test_server/unit/common/config/test_app_config.py b/test/unit/common/config/test_app_config.py similarity index 94% rename from backend/test/test_server/unit/common/config/test_app_config.py rename to test/unit/common/config/test_app_config.py index ba054b92..e93cef2b 100644 --- a/backend/test/test_server/unit/common/config/test_app_config.py +++ b/test/unit/common/config/test_app_config.py @@ -4,11 +4,11 @@ import unittest import yaml -from backend.server.default_config import default_config -from backend.server.common.config.app_config import AppConfig -from backend.common.errors import ConfigurationError -from backend.test.test_server.unit.common.config import ConfigTests -from backend.test import FIXTURES_ROOT, H5AD_FIXTURE +from server.default_config import default_config +from server.common.config.app_config import AppConfig +from server.common.errors import ConfigurationError +from test.unit.common.config import ConfigTests +from test import FIXTURES_ROOT, H5AD_FIXTURE class AppConfigTest(ConfigTests): @@ -131,7 +131,8 @@ class AppConfigTest(ConfigTests): # test simple value in default dataset config.update_single_config_from_path_and_value( - ["dataset", "user_annotations"], "dummy_location", + ["dataset", "user_annotations"], + "dummy_location", ) # error checking diff --git a/backend/test/test_server/unit/common/config/test_base_config.py b/test/unit/common/config/test_base_config.py similarity index 88% rename from backend/test/test_server/unit/common/config/test_base_config.py rename to test/unit/common/config/test_base_config.py index 9701e0ad..1401ff31 100644 --- a/backend/test/test_server/unit/common/config/test_base_config.py +++ b/test/unit/common/config/test_base_config.py @@ -1,9 +1,9 @@ import unittest -from backend.server.common.config.app_config import AppConfig -from backend.test import H5AD_FIXTURE -from backend.common.errors import ConfigurationError -from backend.test.test_server.unit.common.config import ConfigTests +from server.common.config.app_config import AppConfig +from test import H5AD_FIXTURE +from server.common.errors import ConfigurationError +from test.unit.common.config import ConfigTests class BaseConfigTest(ConfigTests): @@ -48,7 +48,7 @@ class BaseConfigTest(ConfigTests): ("app__verbose", True, False), ("app__flask_secret_key", "secret", None), ("single_dataset__datapath", H5AD_FIXTURE, None), - ('data_locator__s3__region_name', 'us-east-1', True) + ("data_locator__s3__region_name", "us-east-1", True), ], ) self.assertEqual(dataset_changes, [("diffexp__lfc_cutoff", 0.05, 0.01)]) diff --git a/backend/test/test_server/unit/common/config/test_dataset_config.py b/test/unit/common/config/test_dataset_config.py similarity index 91% rename from backend/test/test_server/unit/common/config/test_dataset_config.py rename to test/unit/common/config/test_dataset_config.py index b60a5f62..b8cd7740 100644 --- a/backend/test/test_server/unit/common/config/test_dataset_config.py +++ b/test/unit/common/config/test_dataset_config.py @@ -4,13 +4,13 @@ import tempfile import unittest from unittest.mock import patch -from backend.server.common.annotations.local_file_csv import AnnotationsLocalFile -from backend.server.common.config.app_config import AppConfig -from backend.server.common.config.base_config import BaseConfig -from backend.test import H5AD_FIXTURE +from server.common.annotations.local_file_csv import AnnotationsLocalFile +from server.common.config.app_config import AppConfig +from server.common.config.base_config import BaseConfig +from test import H5AD_FIXTURE -from backend.common.errors import ConfigurationError -from backend.test.test_server.unit.common.config import ConfigTests +from server.common.errors import ConfigurationError +from test.unit.common.config import ConfigTests class TestDatasetConfig(ConfigTests): @@ -41,7 +41,7 @@ class TestDatasetConfig(ConfigTests): self.assertEqual(config.dataset_config.user_annotations__type, "local_file_csv") self.assertEqual(config.dataset_config.diffexp__lfc_cutoff, 0.01) - @patch("backend.server.common.config.dataset_config.BaseConfig.validate_correct_type_of_configuration_attribute") + @patch("server.common.config.dataset_config.BaseConfig.validate_correct_type_of_configuration_attribute") def test_complete_config_checks_all_attr(self, mock_check_attrs): mock_check_attrs.side_effect = BaseConfig.validate_correct_type_of_configuration_attribute() self.dataset_config.complete_config(self.context) diff --git a/backend/test/test_server/unit/common/config/test_external_config.py b/test/unit/common/config/test_external_config.py similarity index 91% rename from backend/test/test_server/unit/common/config/test_external_config.py rename to test/unit/common/config/test_external_config.py index 307a341f..7c2fe6f4 100644 --- a/backend/test/test_server/unit/common/config/test_external_config.py +++ b/test/unit/common/config/test_external_config.py @@ -2,12 +2,13 @@ import os import requests -from backend.common.errors import ConfigurationError -from backend.server.common.config.app_config import AppConfig -from backend.test.test_server.unit import test_server -from backend.test import FIXTURES_ROOT -from backend.common.utils.type_conversion_utils import convert_string_to_value -from backend.test.test_server.unit.common.config import ConfigTests +from server.common.config.app_config import AppConfig +from server.common.errors import ConfigurationError +from server.common.utils.type_conversion_utils import convert_string_to_value + +from test import FIXTURES_ROOT +from test.unit import test_server +from test.unit.common.config import ConfigTests class TestExternalConfig(ConfigTests): diff --git a/backend/test/test_server/unit/common/config/test_server_config.py b/test/unit/common/config/test_server_config.py similarity index 87% rename from backend/test/test_server/unit/common/config/test_server_config.py rename to test/unit/common/config/test_server_config.py index 181ad5e2..7e9f0707 100644 --- a/backend/test/test_server/unit/common/config/test_server_config.py +++ b/test/unit/common/config/test_server_config.py @@ -3,12 +3,12 @@ import unittest from unittest import mock from unittest.mock import patch -from backend.server.common.config.base_config import BaseConfig -from backend.test import H5AD_FIXTURE +from server.common.config.base_config import BaseConfig +from test import H5AD_FIXTURE -from backend.server.common.config.app_config import AppConfig -from backend.common.errors import ConfigurationError -from backend.test.test_server.unit.common.config import ConfigTests +from server.common.config.app_config import AppConfig +from server.common.errors import ConfigurationError +from test.unit.common.config import ConfigTests def mockenv(**envvars): @@ -45,7 +45,7 @@ class TestServerConfig(ConfigTests): with self.assertRaises(ConfigurationError): invalid_config.complete_config() - @patch("backend.server.common.config.server_config.BaseConfig.validate_correct_type_of_configuration_attribute") + @patch("server.common.config.server_config.BaseConfig.validate_correct_type_of_configuration_attribute") def test_complete_config_checks_all_attr(self, mock_check_attrs): mock_check_attrs.side_effect = BaseConfig.validate_correct_type_of_configuration_attribute() self.server_config.complete_config(self.context) @@ -56,7 +56,7 @@ class TestServerConfig(ConfigTests): with self.assertRaises(ConfigurationError): config.server_config.handle_app(self.context) - @patch("backend.server.common.config.server_config.discover_s3_region_name") + @patch("server.common.config.server_config.discover_s3_region_name") def test_handle_data_locator_works_for_default_types(self, mock_discover_region_name): mock_discover_region_name.return_value = None # Default config @@ -95,9 +95,7 @@ class TestServerConfig(ConfigTests): self.assertEqual(config.server_config.app__flask_secret_key, "KEY_FROM_ENV") def test_config_for_single_dataset(self): - file_name = self.custom_app_config( - config_file_name="single_dataset.yml", dataset_datapath=f"{H5AD_FIXTURE}" - ) + file_name = self.custom_app_config(config_file_name="single_dataset.yml", dataset_datapath=f"{H5AD_FIXTURE}") config = AppConfig() config.update_from_config_file(file_name) config.server_config.handle_single_dataset(self.context) diff --git a/backend/test/test_server/unit/common/test_api.py b/test/unit/common/test_api.py similarity index 99% rename from backend/test/test_server/unit/common/test_api.py rename to test/unit/common/test_api.py index bb02b037..7f3471f5 100644 --- a/backend/test/test_server/unit/common/test_api.py +++ b/test/unit/common/test_api.py @@ -14,16 +14,16 @@ import numpy as np from parameterized import parameterized_class -import backend.test.decode_fbs as decode_fbs -from backend.server.data_common.matrix_loader import MatrixDataType -from backend.test.test_server.unit import ( +import test.decode_fbs as decode_fbs +from server.data_common.matrix_loader import MatrixDataType +from test.unit import ( data_with_tmp_annotations, make_fbs, start_test_server, stop_test_server, ) -from backend.test.fixtures.fixtures import pbmc3k_colors -from backend.test import PROJECT_ROOT, FIXTURES_ROOT +from test.fixtures.fixtures import pbmc3k_colors +from test import PROJECT_ROOT, FIXTURES_ROOT BAD_FILTER = {"filter": {"obs": {"annotation_value": [{"name": "xyz"}]}}} diff --git a/backend/test/test_server/unit/common/test_corpora.py b/test/unit/common/test_corpora.py similarity index 97% rename from backend/test/test_server/unit/common/test_corpora.py rename to test/unit/common/test_corpora.py index f4e7c253..f192c912 100644 --- a/backend/test/test_server/unit/common/test_corpora.py +++ b/test/unit/common/test_corpora.py @@ -7,13 +7,13 @@ from http import HTTPStatus import anndata import requests -from backend.server.common.corpora import ( +from server.common.corpora import ( corpora_get_versions_from_anndata, corpora_is_version_supported, corpora_get_props_from_anndata, ) -from backend.test.test_server.unit import start_test_server, stop_test_server -from backend.test import PROJECT_ROOT +from test.unit import start_test_server, stop_test_server +from test import PROJECT_ROOT VERSION = "v0.2" diff --git a/backend/test/test_server/unit/common/test_nan_rest.py b/test/unit/common/test_nan_rest.py similarity index 92% rename from backend/test/test_server/unit/common/test_nan_rest.py rename to test/unit/common/test_nan_rest.py index 9690cb66..a85a1178 100644 --- a/backend/test/test_server/unit/common/test_nan_rest.py +++ b/test/unit/common/test_nan_rest.py @@ -1,9 +1,9 @@ from http import HTTPStatus import unittest import math -from backend.test.test_server.unit import start_test_server, stop_test_server -from backend.test import FIXTURES_ROOT -import backend.test.decode_fbs as decode_fbs +from test.unit import start_test_server, stop_test_server +from test import FIXTURES_ROOT +import test.decode_fbs as decode_fbs import requests diff --git a/backend/test/test_server/unit/common/test_rest.py b/test/unit/common/test_rest.py similarity index 95% rename from backend/test/test_server/unit/common/test_rest.py rename to test/unit/common/test_rest.py index 809fde43..8cfeb9ad 100644 --- a/backend/test/test_server/unit/common/test_rest.py +++ b/test/unit/common/test_rest.py @@ -1,8 +1,8 @@ import unittest from urllib.parse import parse_qs from werkzeug.datastructures import MultiDict -from backend.common.errors import FilterError -from backend.server.common.rest import _query_parameter_to_filter +from server.common.errors import FilterError +from server.common.rest import _query_parameter_to_filter def _qsparse(qs): diff --git a/backend/test/test_server/unit/common/test_writable_annotation.py b/test/unit/common/test_writable_annotation.py similarity index 96% rename from backend/test/test_server/unit/common/test_writable_annotation.py rename to test/unit/common/test_writable_annotation.py index 635a26c1..3e94438c 100644 --- a/backend/test/test_server/unit/common/test_writable_annotation.py +++ b/test/unit/common/test_writable_annotation.py @@ -6,10 +6,10 @@ from os import path, listdir import numpy as np import pandas as pd -import backend.test.decode_fbs as decode_fbs -from backend.server.common.rest import annotations_put_fbs_helper, schema_get_helper -from backend.server.data_common.matrix_loader import MatrixDataType -from backend.test.test_server.unit import data_with_tmp_annotations, make_fbs +import test.decode_fbs as decode_fbs +from server.common.rest import annotations_put_fbs_helper, schema_get_helper +from server.data_common.matrix_loader import MatrixDataType +from test.unit import data_with_tmp_annotations, make_fbs class WritableAnnotationTest(unittest.TestCase): diff --git a/backend/test/fixtures/__init__.py b/test/unit/common/utils/__init__.py similarity index 100% rename from backend/test/fixtures/__init__.py rename to test/unit/common/utils/__init__.py diff --git a/backend/test/test_server/unit/common/utils/test_utils.py b/test/unit/common/utils/test_utils.py similarity index 72% rename from backend/test/test_server/unit/common/utils/test_utils.py rename to test/unit/common/utils/test_utils.py index 49077179..48102c24 100644 --- a/backend/test/test_server/unit/common/utils/test_utils.py +++ b/test/unit/common/utils/test_utils.py @@ -2,14 +2,14 @@ import os import shutil import unittest -from backend.common.utils.utils import import_plugins -from backend.test import PROJECT_ROOT, random_string +from server.common.utils.utils import import_plugins +from test import PROJECT_ROOT, random_string class TestPlugins(unittest.TestCase): """ Test plugin import functionality """ - plugins_dir = f"{PROJECT_ROOT}/backend/test/plugins" + plugins_dir = f"{PROJECT_ROOT}/test/plugins" test_plugin_path = f"{plugins_dir}/foo.py" secret = random_string(8) @@ -27,8 +27,8 @@ class TestPlugins(unittest.TestCase): def test_import_plugins(self): self.assertTrue(os.path.isfile(self.test_plugin_path)) - loaded_modules = import_plugins("backend.test.plugins") + loaded_modules = import_plugins("test.plugins") # test that import plugins found the file - self.assertEqual(["backend.test.plugins.foo"], [ele.__name__ for ele in loaded_modules]) + self.assertEqual(["test.plugins.foo"], [ele.__name__ for ele in loaded_modules]) # test that the module was properly executed self.assertEqual(self.secret, loaded_modules[0].SECRET) diff --git a/backend/test/test_common/__init__.py b/test/unit/compute/__init__.py similarity index 100% rename from backend/test/test_common/__init__.py rename to test/unit/compute/__init__.py diff --git a/backend/test/test_server/unit/compute/test_diffexp_h5ad.py b/test/unit/compute/test_diffexp_h5ad.py similarity index 95% rename from backend/test/test_server/unit/compute/test_diffexp_h5ad.py rename to test/unit/compute/test_diffexp_h5ad.py index 739888ce..883be3da 100644 --- a/backend/test/test_server/unit/compute/test_diffexp_h5ad.py +++ b/test/unit/compute/test_diffexp_h5ad.py @@ -2,10 +2,10 @@ import unittest import numpy as np -from backend.common.compute import diffexp_generic -from backend.server.data_common.matrix_loader import MatrixDataLoader -from backend.test.test_server.unit import app_config -from backend.test import PROJECT_ROOT +from server.common.compute import diffexp_generic +from server.data_common.matrix_loader import MatrixDataLoader +from test.unit import app_config +from test import PROJECT_ROOT class DiffExpTest(unittest.TestCase): diff --git a/backend/test/test_server/unit/compute/test_est_dist.py b/test/unit/compute/test_est_dist.py similarity index 94% rename from backend/test/test_server/unit/compute/test_est_dist.py rename to test/unit/compute/test_est_dist.py index 2fb7bace..6c78c37b 100644 --- a/backend/test/test_server/unit/compute/test_est_dist.py +++ b/test/unit/compute/test_est_dist.py @@ -1,11 +1,11 @@ import unittest import numpy as np from scipy import sparse -from backend.common.compute.estimate_distribution import estimate_approximate_distribution -from backend.common.constants import XApproximateDistribution -from backend.server.data_common.matrix_loader import MatrixDataLoader -from backend.test.test_server.unit import app_config -from backend.test import PROJECT_ROOT +from server.common.compute.estimate_distribution import estimate_approximate_distribution +from server.common.constants import XApproximateDistribution +from server.data_common.matrix_loader import MatrixDataLoader +from test.unit import app_config +from test import PROJECT_ROOT class EstDistTest(unittest.TestCase): diff --git a/backend/test/test_common/unit/fbs/__init__.py b/test/unit/data_anndata/__init__.py similarity index 100% rename from backend/test/test_common/unit/fbs/__init__.py rename to test/unit/data_anndata/__init__.py diff --git a/backend/test/test_server/unit/data_anndata/test_anndata_adaptor.py b/test/unit/data_anndata/test_anndata_adaptor.py similarity index 96% rename from backend/test/test_server/unit/data_anndata/test_anndata_adaptor.py rename to test/unit/data_anndata/test_anndata_adaptor.py index 19ba07aa..3d54f0d5 100644 --- a/backend/test/test_server/unit/data_anndata/test_anndata_adaptor.py +++ b/test/unit/data_anndata/test_anndata_adaptor.py @@ -8,13 +8,13 @@ import pandas as pd import pytest from parameterized import parameterized_class -import backend.test.decode_fbs as decode_fbs -from backend.common.utils.data_locator import DataLocator -from backend.common.errors import FilterError -from backend.server.data_anndata.anndata_adaptor import AnndataAdaptor -from backend.test import PROJECT_ROOT, FIXTURES_ROOT -from backend.test.test_server.unit import app_config -from backend.test.fixtures.fixtures import pbmc3k_colors +import test.decode_fbs as decode_fbs +from server.common.utils.data_locator import DataLocator +from server.common.errors import FilterError +from server.data_anndata.anndata_adaptor import AnndataAdaptor +from test import PROJECT_ROOT, FIXTURES_ROOT +from test.unit import app_config +from test.fixtures.fixtures import pbmc3k_colors """ Test the anndata adaptor using the pbmc3k data set. diff --git a/backend/test/test_server/unit/data_anndata/test_anndata_adaptor_data_load.py b/test/unit/data_anndata/test_anndata_adaptor_data_load.py similarity index 78% rename from backend/test/test_server/unit/data_anndata/test_anndata_adaptor_data_load.py rename to test/unit/data_anndata/test_anndata_adaptor_data_load.py index 5e52a5d2..6d8e03d9 100644 --- a/backend/test/test_server/unit/data_anndata/test_anndata_adaptor_data_load.py +++ b/test/unit/data_anndata/test_anndata_adaptor_data_load.py @@ -1,10 +1,10 @@ import unittest import json -from backend.common.utils.data_locator import DataLocator -from backend.server.data_anndata.anndata_adaptor import AnndataAdaptor -from backend.server.common.config.app_config import AppConfig -from backend.test import PROJECT_ROOT +from server.common.utils.data_locator import DataLocator +from server.data_anndata.anndata_adaptor import AnndataAdaptor +from server.common.config.app_config import AppConfig +from test import PROJECT_ROOT class DataLoadAdaptorTest(unittest.TestCase): @@ -31,11 +31,11 @@ class DataLoadAdaptorTest(unittest.TestCase): f1 = {"filter": {"obs": {"index": [[0, 500]]}}} f2 = {"filter": {"obs": {"index": [[500, 1000]]}}} result = json.loads(self.data.diffexp_topN(f1["filter"], f2["filter"])) - self.assertEqual(len(result['positive']), 10) - self.assertEqual(len(result['negative']), 10) + self.assertEqual(len(result["positive"]), 10) + self.assertEqual(len(result["negative"]), 10) result = json.loads(self.data.diffexp_topN(f1["filter"], f2["filter"], 20)) - self.assertEqual(len(result['positive']), 20) - self.assertEqual(len(result['negative']), 20) + self.assertEqual(len(result["positive"]), 20) + self.assertEqual(len(result["negative"]), 20) class DataLocatorAdaptorTest(unittest.TestCase): @@ -46,11 +46,14 @@ class DataLocatorAdaptorTest(unittest.TestCase): def get_basic_config(self): config = AppConfig() config.update_server_config( - single_dataset__obs_names=None, single_dataset__var_names=None, + single_dataset__obs_names=None, + single_dataset__var_names=None, ) config.update_server_config(app__flask_secret_key="secret") config.update_dataset_config( - embeddings__names=["umap"], presentation__max_categories=100, diffexp__lfc_cutoff=0.01, + embeddings__names=["umap"], + presentation__max_categories=100, + diffexp__lfc_cutoff=0.01, ) return config @@ -61,7 +64,7 @@ class DataLocatorAdaptorTest(unittest.TestCase): self.assertEqual(data.gene_count, 1838) def test_posix_file(self): - locator = DataLocator("../../example-dataset/pbmc3k.h5ad") + locator = DataLocator("example-dataset/pbmc3k.h5ad") config = self.get_basic_config() config.update_server_config(single_dataset__datapath=locator.path) config.complete_config() diff --git a/backend/test/test_server/unit/data_anndata/test_nan_anndata_adaptor.py b/test/unit/data_anndata/test_nan_anndata_adaptor.py similarity index 89% rename from backend/test/test_server/unit/data_anndata/test_nan_anndata_adaptor.py rename to test/unit/data_anndata/test_nan_anndata_adaptor.py index 591133b2..f3266c95 100644 --- a/backend/test/test_server/unit/data_anndata/test_nan_anndata_adaptor.py +++ b/test/unit/data_anndata/test_nan_anndata_adaptor.py @@ -4,12 +4,12 @@ import warnings import pytest -import backend.test.decode_fbs as decode_fbs -from backend.common.utils.data_locator import DataLocator -from backend.common.errors import FilterError -from backend.server.data_anndata.anndata_adaptor import AnndataAdaptor -from backend.test import FIXTURES_ROOT -from backend.test.test_server.unit import app_config +import test.decode_fbs as decode_fbs +from server.common.utils.data_locator import DataLocator +from server.common.errors import FilterError +from server.data_anndata.anndata_adaptor import AnndataAdaptor +from test import FIXTURES_ROOT +from test.unit import app_config class NaNTest(unittest.TestCase): diff --git a/backend/test/test_common/unit/utils/__init__.py b/test/unit/fbs/__init__.py similarity index 100% rename from backend/test/test_common/unit/utils/__init__.py rename to test/unit/fbs/__init__.py diff --git a/backend/test/test_common/unit/fbs/test_matrix.py b/test/unit/fbs/test_matrix.py similarity index 97% rename from backend/test/test_common/unit/fbs/test_matrix.py rename to test/unit/fbs/test_matrix.py index a8e854f9..6c21fac5 100644 --- a/backend/test/test_common/unit/fbs/test_matrix.py +++ b/test/unit/fbs/test_matrix.py @@ -5,10 +5,10 @@ from scipy import sparse from parameterized import parameterized_class import json -from backend.test import decode_fbs -from backend.common.fbs.matrix import encode_matrix_fbs, decode_matrix_fbs -from backend.common.utils.type_conversion_utils import get_dtypes_and_schemas_of_dataframe -import backend.common.fbs as fbs +from test import decode_fbs +from server.common.fbs.matrix import encode_matrix_fbs, decode_matrix_fbs +from server.common.utils.type_conversion_utils import get_dtypes_and_schemas_of_dataframe +import server.common.fbs as fbs class FbsTests(unittest.TestCase): diff --git a/backend/test/test_common/unit/test_colors.py b/test/unit/test_colors.py similarity index 86% rename from backend/test/test_common/unit/test_colors.py rename to test/unit/test_colors.py index a0041f02..dccc0055 100644 --- a/backend/test/test_common/unit/test_colors.py +++ b/test/unit/test_colors.py @@ -2,10 +2,10 @@ import unittest import anndata -from backend.common.colors import convert_color_to_hex_format, convert_anndata_category_colors_to_cxg_category_colors -from backend.common.errors import ColorFormatException -from backend.test import PROJECT_ROOT -from backend.test.fixtures.fixtures import pbmc3k_colors +from server.common.colors import convert_color_to_hex_format, convert_anndata_category_colors_to_cxg_category_colors +from server.common.errors import ColorFormatException +from test import PROJECT_ROOT +from test.fixtures.fixtures import pbmc3k_colors class ColorsTest(unittest.TestCase): diff --git a/backend/test/test_server/__init__.py b/test/unit/utils/__init__.py similarity index 100% rename from backend/test/test_server/__init__.py rename to test/unit/utils/__init__.py diff --git a/backend/test/test_common/unit/utils/test_jsonify_strict.py b/test/unit/utils/test_jsonify_strict.py similarity index 98% rename from backend/test/test_common/unit/utils/test_jsonify_strict.py rename to test/unit/utils/test_jsonify_strict.py index b4d873df..5a2fb075 100644 --- a/backend/test/test_common/unit/utils/test_jsonify_strict.py +++ b/test/unit/utils/test_jsonify_strict.py @@ -1,7 +1,7 @@ import unittest import numpy as np -from backend.common.utils.utils import ( +from server.common.utils.utils import ( jsonify_strict, ) diff --git a/backend/test/test_common/unit/utils/test_type_conversion_utils.py b/test/unit/utils/test_type_conversion_utils.py similarity index 99% rename from backend/test/test_common/unit/utils/test_type_conversion_utils.py rename to test/unit/utils/test_type_conversion_utils.py index deacaa29..43328890 100644 --- a/backend/test/test_common/unit/utils/test_type_conversion_utils.py +++ b/test/unit/utils/test_type_conversion_utils.py @@ -7,7 +7,7 @@ import pandas as pd from pandas import Series, DataFrame from scipy import sparse -from backend.common.utils.type_conversion_utils import ( +from server.common.utils.type_conversion_utils import ( get_encoding_dtype_of_array, get_schema_type_hint_of_array, get_dtypes_and_schemas_of_dataframe,