uvex_transients.utils.spawn_seeds#
- uvex_transients.utils.spawn_seeds(spawn_sequence: SeedSequence, n: int) NDArray[uint64][source]#
Derive
nindependent, reproducible, individually storable seeds.Each returned seed is a single
uint64, directly usable withget_rng()(e.g. asLightcurve.sample_parameters(rng=seed)) to reproducibly regenerate that one event’s parameters later without needing to replay the draws for any other event – the compression trick behind only ever storing a seed per event rather than its sampled parameters.Uses ~numpy.random.SeedSequence.spawn, which is NumPy’s recommended mechanism for generating many independent reproducible streams from one root; a naive
base_seed + ischeme is not guaranteed to avoid subtle stream correlations the way spawning is.- Parameters:
spawn_sequence (
numpy.random.SeedSequence) – Typically the second element returned bysplit_root_seed().n (
int) – Number of seeds to derive.
- Returns:
uint64array of shape(n,).- Return type: