Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance improvement for SOMA collection-mapper UDF #596

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/tiledb/cloud/soma/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Any, Callable, Dict, Optional, Sequence, Tuple

import anndata as ad
import tiledb
import tiledbsoma

from tiledb.cloud import dag
Expand Down Expand Up @@ -233,8 +234,19 @@ 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
# https://github.com/single-cell-data/TileDB-SOMA/issues/2787
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
Loading