Skip to content

Commit

Permalink
Accelerate SOMA collection mapper graph construction (#597)
Browse files Browse the repository at this point in the history
* Use tiledb-py to retrieve group members
* Sort imports with ruff
* Add john's comment
  • Loading branch information
aaronwolen authored Jul 10, 2024
1 parent d3bef52 commit c497385
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/tiledb/cloud/soma/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import anndata as ad
import tiledbsoma

import tiledb
from tiledb.cloud import dag
from tiledb.cloud._common import functions
from tiledb.cloud.utilities import get_logger_wrapper
Expand Down Expand Up @@ -233,8 +234,18 @@ def build_collection_mapper_workflow_graph(
"Retrieving SOMA Experiment URIs from SOMACollection %s"
% soma_collection_uri
)
with tiledbsoma.Collection.open(soma_collection_uri) as soco:
soma_experiment_uris = {k: v.uri for k, v in soco.items()}

# Alternative:
#
# with tiledbsoma.Collection.open(soma_collection_uri) as soco:
# soma_experiment_uris = {k: v.uri for k, v in soco.items()}
#
# -- however, that opens all the members sequentially, and we don't need
# that overhead here in the launcher node.
#
# See also: sc-49443
with tiledb.Group(soma_collection_uri) as grp:
soma_experiment_uris = {mbr.name: mbr.uri for mbr in grp}

if experiment_names is not None:
logger.info("Filtering SOMA Experiment URIs for specified names")
Expand Down

0 comments on commit c497385

Please sign in to comment.