Problem
_jitter() in util.py calls np.random.uniform() using the global RNG, meaning results are non-reproducible even when the user passes random_seed to the calling function. The random_seed parameter exists in the public API (e.g., cohort_diversity_stats) but is never threaded through to _jitter().
util.py:903
def _jitter(a, fraction):
r = a.max() - a.min()
return a + fraction * np.random.uniform(-r, r, a.shape) # global RNG!
Proposed Fix
Add an optional random_state parameter defaulting to np.random. Called from pca.py lines 403–509.
Impact
Makes PCA plots reproducible when users set random_seed.
Problem
_jitter()inutil.pycallsnp.random.uniform()using the global RNG, meaning results are non-reproducible even when the user passesrandom_seedto the calling function. Therandom_seedparameter exists in the public API (e.g.,cohort_diversity_stats) but is never threaded through to_jitter().util.py:903Proposed Fix
Add an optional
random_stateparameter defaulting tonp.random. Called frompca.pylines 403–509.Impact
Makes PCA plots reproducible when users set
random_seed.