Skip to content
Open
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions src/scanpy/tools/_umap.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ def umap(
# for the init condition in the UMAP embedding
default_epochs = 500 if neighbors["connectivities"].shape[0] <= 10000 else 200
n_epochs = default_epochs if maxiter is None else maxiter
if parallel and random_state is not None:
warnings.warn(
"Parallel execution was expected to be disabled when both `parallel=True` and `random_state` are set, "
"to ensure reproducibility. However, parallel execution still seems to occur, which may lead to "
"non-deterministic results."
)
Comment on lines +219 to +224
Copy link
Contributor

@ilan-gold ilan-gold Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to the umap repo to give user more context. Something like "UMAP reports that parallel execution should error with a random seed to ensure reproducibility. Parallel execution may occur nonetheless, which can lead to non-deterministic results." with a link to their docs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then make sure this warning is raised in tests

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update this once i have clarification from lmcinnes/umap#1155

X_umap, _ = simplicial_set_embedding(
data=X,
graph=neighbors["connectivities"].tocoo(),
Expand Down
Loading