Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

random_seed not propagated to randomise_axial_position (dormant reproducibility gap)

Aperta
#135 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
numpy, python
Ambito
backend

Direzione di ricerca

Inizia in src/vlab4mic/generate/coordinates_field.py leggendo CoordinatesField.randomise_axial_position() e la sua chiamata da _gen_abs_from_rel_positions() intorno alla riga 501. Traccia il modo in cui set_molecules_params o create_minimal_field gestisce il seed, quindi verifica che le configurazioni che usano axial_offset producano un posizionamento assiale ripetibile con lo stesso seed senza compromettere il comportamento esistente della posizione e dell’orientamento.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Follow-up from the random-seed propagation work in #134.

What
CoordinatesField.randomise_axial_position() (src/vlab4mic/generate/coordinates_field.py) builds its RNG as np.random.default_rng(seed=random_seed), but its only caller, _gen_abs_from_rel_positions() (line ~501), invokes it with no argument:

if self.axial_offset is not None:
    self.randomise_axial_position()   # random_seed defaults to None

So when axial offsets are in use, the axial z-placement draws from a fresh non-deterministic Generator and ignores the seed (a default_rng(None) does not read the global np.random.seed set in experiments.py). All other stochastic inputs (positions via the global seed, orientations and rotations via the threaded random_seed) are reproducible after #134.

Impact: dormant. randomise_axial_position only runs when self.axial_offset is not None. No current article-figure script sets axial_offset (the NPC scripts use axial_precision / axial_resolution_nm, which are unrelated PSF params), so the manuscript figures are unaffected and reproducible. This only bites a user who explicitly configures axial_offset.

Suggested fix
_gen_abs_from_rel_positions() is a no-arg helper called from many places, so threading the seed through the call site is awkward. Cleaner: persist the seed on the field instance (e.g. set self.random_seed in set_molecules_params / create_minimal_field) and have randomise_axial_position default to self.random_seed. Then drop the now-redundant random_seed params that are accepted but unused in the global-np.random position helpers (generate_random_positions), or wire them similarly, for a consistent seeding story.

Priority: low (latent; does not affect current figures).

Lingua principale
Python
Stelle
3
Fork
1
Merge medio
1g 7h
PR unite (30g)
13

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di HenriquesLab/VLab4Mic

Tutte le issue di HenriquesLab/VLab4Mic

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.