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/
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 85/100
Hướng nghiên cứu
Bắt đầu với Configuration.check_fresh_run() và cách xử lý continue_run trong pybnf/algorithms/samplers/base.py:506; đọc khóa được ghi tài liệu trong docs/config_keys.rst và logic ghi tệp trong pybnf/algorithms/samplers/adaptive_mcmc.py. Thêm các bước kiểm tra trước khi chạm đến thư mục đầu ra, sau đó dùng kiểm thử để bao phủ cả hai trường hợp từ chối: sampler không phải am và am không có adaptive_files/MLE_params.txt. Hoàn tất khi các trường hợp đó thất bại rõ ràng mà không thay thế đầu ra hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 26
- Fork
- 25
- Merge trung bình
- 4 giờ 25 phút
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của lanl/PyBNF
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
min_objective stops a sampler run early and reports "Fitting complete": samplers should refuse itĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug minor
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
-
bug minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
bug tech debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Issue tương tự
-
docs(contributing): the two things that silently block a PRCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởavailable documentation good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 95/100
Nixitov/Riptide-Native#944 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
JTHCode/secretguard#24 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: middleware documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainer thường phản hồi trong vòng 1 ngày