From af2778f87effcfdb75ffc0a342854393c83909f7 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Tue, 5 Nov 2024 17:19:22 -0500 Subject: [PATCH] fix profiler/tests/objects.py --- profiler/tests/objects.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/profiler/tests/objects.py b/profiler/tests/objects.py index f934d6a973..8ef62b8485 100644 --- a/profiler/tests/objects.py +++ b/profiler/tests/objects.py @@ -1,8 +1,18 @@ import tiledbsoma +import tarfile +import tempfile + +sparse_uri = tempfile.mktemp() +with tarfile.open("../apis/python/notebooks/data/pbmc3k-sparse.tgz") as handle: + handle.extractall(sparse_uri) + +dense_uri = tempfile.mktemp() +with tarfile.open("../apis/python/notebooks/data/pbmc3k-dense.tgz") as handle: + handle.extractall(dense_uri) # This test is extracted from tutorial_soma_objects.ipynb notebook # To test the profile run: `python main.py python tests/objects.py` in the profile folder -experiment = tiledbsoma.open("../apis/python/notebooks/data/dense/pbmc3k") +experiment = soma.Experiment.open(sparse_uri) obs = experiment.obs print(f"obs schema {obs.schema}") @@ -28,7 +38,7 @@ print(X.read((None, int(idx[0]))).to_numpy()) -experiment = tiledbsoma.open("../apis/python/notebooks/data/sparse/pbmc3k") +experiment = tiledbsoma.open(dense_uri) X = experiment.ms["RNA"].X["data"] print(X.schema)