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/
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 85/100
調査の方向性
まず Configuration.check_fresh_run() と pybnf/algorithms/samplers/base.py:506 の continue_run の処理を確認し、docs/config_keys.rst に記載されたキーと pybnf/algorithms/samplers/adaptive_mcmc.py のファイル書き込みロジックを読みます。出力ディレクトリに触れる前にチェックを追加し、次に両方の拒否ケースをテストでカバーします。対象は am 以外の sampler と、adaptive_files/MLE_params.txt がない am です。既存の出力を置き換えることなく、これらのケースが明確に失敗すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 26
- フォーク
- 25
- 平均マージ
- 4時間 25分
- マージ済み PR(30日)
- 9
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
lanl/PyBNF のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
min_objective stops a sampler run early and reports "Fitting complete": samplers should refuse itオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug minor
難易度 1/5 1〜3時間 初心者へのやさしさ 92/100
-
bug minor
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bug tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
似ている issue
-
docs(contributing): the two things that silently block a PR対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンavailable documentation good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 95/100
Nixitov/Riptide-Native#944 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
JTHCode/secretguard#24 ·
メンテナーはふだん 1 日以内に返信
-
area: middleware documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
omarelshamy25x/shamy-hijri#63 ·
メンテナーはふだん 1 日以内に返信