Skip to content

Commit

Permalink
fix profiler/tests/objects.py
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Nov 5, 2024
1 parent 2de5735 commit af2778f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions profiler/tests/objects.py
Original file line number Diff line number Diff line change
@@ -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}")
Expand All @@ -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)
Expand Down

0 comments on commit af2778f

Please sign in to comment.