335 shipped example confs cannot load: all 280 Mallela2022MSAs confs fail to parse, and 335 name BNG2.pl at /usr/local/anaconda3

Đang mở
#1,075 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
67/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 the configuration parser in pybnf and inspect the tracked .conf files under examples/Mallela2022MSAs/, examples/Mallela2021States/, and examples/Miller2022NavajoNation/. Reproduce the parse failure and check how bng_command overrides BNGPATH; then parse the affected examples after correcting their paths and simulator settings. Done when the examples load with BNGPATH configured and a test catches regressions across tracked example configs.

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

Mô tả

bug

335 tracked example confs cannot be loaded as shipped.

  1. All 280 confs in examples/Mallela2022MSAs/ fail to parse. Each directory is named for a metro area, such as "Abilene, TX". The conf uses that name unquoted, as in output_dir = Abilene, TX_output and model = Abilene, TX.bngl: Abilene, TX.exp. The parser stops at the first line: "Parsing configuration key 'output_dir' on line 1. output_dir should be specified in the format 'output_dir=s' where s is a string".
  2. 335 confs set bng_command = /usr/local/anaconda3/bin/BNG2.pl, a path on the original author's machine: Mallela2021States (50), Mallela2022MSAs (280) and Miller2022NavajoNation (5). bng_command takes precedence over BNGPATH. So on any other machine, Mallela2021States/SI_files/Alabama/Alabama.conf (for example) is refused with "The BioNetGen simulator (BNG2.pl) was not found at the specified location", even with BNGPATH set.

#1066 removed an unused starting_params line from 334 of these confs. That edit changed nothing about whether they run; they could not run before it either. Checked on main at cbb8159c.

Reproduction
import subprocess
from pybnf import parse, printing

files = subprocess.run(['git', '-c', 'core.quotepath=off', 'ls-files', 'examples/*.conf'],
                       capture_output=True, text=True).stdout.splitlines()
mallela = [f for f in files if f.startswith('examples/Mallela2022MSAs/')]
bad = 0
for f in mallela:
    try:
        parse.ploop(open(f).read().splitlines(keepends=True))
    except printing.PybnfError:
        bad += 1
print(len(mallela), bad)   # 280 280
print(sum('/usr/local/anaconda3' in open(f, errors='replace').read() for f in files))   # 335
What should happen
  • Make the Mallela2022MSAs confs parse. Either give their paths names without commas and spaces, or have the grammar accept a quoted path, if it doesn't already.
  • Delete the bng_command lines, so the confs use BNGPATH like the other examples.
  • Add a test that loads every tracked example conf, or at least parses it. That would catch both problems.
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.