scverse / scverse/squidpy

ligrec does seed + worker_id antipattern

Open
#1,131 0 comments 0 reactions 1 assignee View on GitHub

@selmanozleyen is already working on this.

Since Mar 2, 2026.

Dominant language
Python
Stars
598
Forks
121
Avg merge
3d 11h
Merged PRs (30d)
3

Description

Report

Hi,

https://numpy.org/doc/stable/reference/random/parallel.html shows the antipattern here

# UNSAFE! Do not do this!
worker_seed = root_seed + worker_id
rng = np.random.RandomState(worker_seed)

But we do this in ligrec here: https://github.com/scverse/squidpy/blob/95d8b18a875fccb6cc9e9d90286b121d48f5cd2c/src/squidpy/gr/_ligrec.py#L821

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.