continue_run = 1 dies with "an unknown error" on every sampler but am, and on am with no earlier run, after -o has already replaced Results/
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 85/100
Direzione di ricerca
Inizia da Configuration.check_fresh_run() e dalla gestione di continue_run in pybnf/algorithms/samplers/base.py:506; leggi la chiave documentata in docs/config_keys.rst e la logica di scrittura del file in pybnf/algorithms/samplers/adaptive_mcmc.py. Aggiungi controlli prima di toccare la directory di output, poi copri entrambi i casi di rifiuto con dei test: sampler diversi da am e am senza adaptive_files/MLE_params.txt. Il lavoro è concluso quando questi casi falliscono chiaramente senza sostituire l'output esistente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
continue_run = 1 starts every chain from adaptive_files/MLE_params.txt, a file only am writes (pybnf/algorithms/samplers/adaptive_mcmc.py). The key is documented under "For Adaptive MCMC" in docs/config_keys.rst. But the sampler base class applies it to every sampler (pybnf/algorithms/samplers/base.py:506), and nothing checks for the file before the run starts. So:
- On dream, p_dream, mh, pt or hmc,
continue_run = 1can never work. - On am, it fails whenever there is no earlier am run in
output_dir.
Either way the run dies with "Sorry, an unknown error occurred: FileNotFoundError: out/adaptive_files/MLE_params.txt not found ... Please report this bug". With -o, the earlier run's Results/ has already been replaced by then, so the user loses that output and gets a crash in return.
Found while reviewing #1066. Reproduced on main at cbb8159c.
Reproduction
-
Run this dream conf with
pybnf -c x.conf -o. It finishes and leavesout/Results/withsamples.txtand the credible intervals.edition = 2 objective = gaussian, mean = 0 0, variance = 1 1 uniform_var = g1 -10 10 uniform_var = g2 -10 10 random_seed = 1 output_dir = out job_type = dream population_size = 4 max_iterations = 50 burn_in = 10 sample_every = 1 -
Add
continue_run = 1and runpybnf -c x.conf -oagain. It exits 1 with the FileNotFoundError above, asking the user to report a bug.out/Results/now holds onlyx.confand an emptysorted_params_end.txt.
What should happen
Check this at start, in Configuration.check_fresh_run(), before the output directory is touched:
- refuse
continue_run = 1on any sampler other than am, saying that only am writes the files it reads; - on am, refuse it when
adaptive_files/MLE_params.txtis missing, naming the file.
Each refusal needs a test. Related: #1044, about what continue_run does with the file's contents when it does exist.
- Lingua principale
- Python
- Stelle
- 26
- Fork
- 25
- Merge medio
- 4h 25m
- PR unite (30g)
- 9
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lanl/PyBNF
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
min_objective stops a sampler run early and reports "Fitting complete": samplers should refuse itApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug minor
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
-
bug minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Issue simili
-
docs(contributing): the two things that silently block a PRForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaavailable documentation good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 95/100
Nixitov/Riptide-Native#944 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
JTHCode/secretguard#24 ·
I maintainer di solito rispondono entro 1 giorno
-
area: middleware documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
omarelshamy25x/shamy-hijri#63 ·
I maintainer di solito rispondono entro 1 giorno