The notebook helper's run_fit ignores refine and bootstrap without a word

Đang mở
#1,073 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
73/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend, testing

Hướng nghiên cứu

Start with examples/notebooks/pybnf_notebook.py and compare run_fit with the refine and bootstrap flow in pybnf.main; the issue asks that this work be shared or that unsupported settings be rejected. Add a test for refine or bootstrap and confirm the notebook helper either runs the requested phase or reports clearly that it is skipped. The _report_parallelism traceback is a separate reported problem to investigate in the same helper.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug silent-incorrectness

The notebook helper's run_fit (examples/notebooks/pybnf_notebook.py) runs only the main fit. It never runs the refine or bootstrap phases that pybnf -c runs, and it doesn't refuse a conf that sets them. A notebook user who sets bootstrap = 3 or refine = 1 gets the unrefined fit with no bootstrap replicates, and no message saying either step was skipped. This applies to every job type.

Found while reviewing #1066, which made the helper run the same start checks as pybnf.main. Reproduced on main at cbb8159c.

Reproduction
import os, sys
sys.path.insert(0, 'examples/notebooks')
import pybnf_notebook as nb

base = """edition = 2
objective = gaussian, mean = 0 0, variance = 1 1
uniform_var = g1 -10 10
uniform_var = g2 -10 10
random_seed = 1
job_type = de
population_size = 8
max_iterations = 20
"""
alg = nb.run_fit(base + "bootstrap = 3\n", "out_boot")
print(alg.config.config['bootstrap'], sorted(os.listdir(alg.res_dir)))

This prints 3 and ['sorted_params_0.txt', 'sorted_params_backup.txt', 'sorted_params_final.txt', 'start_point.txt']. No replicate runs and nothing reports one. With refine = 1 the output is the same.

The same conf through pybnf -c x.conf -o prints "Beginning bootstrap run 0" through 2 and "Bootstrapping complete", and writes Results/bootstrapped_parameter_sets.txt.

What should happen

Have run_fit run the refine and bootstrap phases as pybnf.main does, sharing that code rather than copying it. Otherwise, have build_algorithm refuse a conf that sets refine or bootstrap, saying the helper runs only the main fit. Either way, add a test.

Separately, run_fit prints a traceback ("'_SyncClient' object has no attribute 'scheduler_info'") from _report_parallelism on every run. It is caught and harmless, but it is noise in every notebook.

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của lanl/PyBNF

Tất cả issue của lanl/PyBNF

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.