Make PyBNF agent-ready, as bngsim 0.18.0 is: a guide in the package, errors and results a program can read, and a command with JSON output
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ 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-api-design, cli, developer-experience
Hướng nghiên cứu
The issue proposes many independently scoped changes; choose one checklist item before starting. Read the corresponding PyBNF implementation and tests, then use the bngsim issue or release branch cited for the related behavior. Define completion around that item's listed outcome and add a test that keeps it correct, as the issue requests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
More and more fits will be set up and run by an AI agent on someone's behalf. The person says "fit this model to these data." The agent writes a configuration file, runs PyBNF, reads the output and reports a best fit. Often nobody reads the configuration. For that user, what matters most is whether PyBNF helps the agent reach a right answer and tells it when it has not.
bngsim did this work under lanl/bngsim#1710, and its coming 0.18.0 release (branch release/0.18.0) has all of it. That issue leaves PyBNF out and says why it should follow: "An agent asked to fit a model needs the same things there." This issue is that work for PyBNF.
PyBNF already has the hard part. It refuses configurations it cannot run correctly, and most refusals name the cause and a fix. PybnfError carries hints, and an edition 1 key such as fit_type gets an error that names job_type. What PyBNF lacks is the easy part. An agent has no guide made for it, errors are text only, every failure exits with code 1, and the results are text files written for a person.
Where an agent goes wrong with PyBNF today, by stage:
- Choosing. PyPI describes PyBNF as fitting BioNetGen and SBML models "using metaheuristics." It does not mention gradient fitting, profile likelihood, the MCMC samplers, Antimony or PEtab. (bngsim: lanl/bngsim#1698.)
- Knowing the keys. The agent remembers an old release, or nothing. There is no guide in the package and no
llms.txton the docs site. - Recovering from a wrong key.
job_typ = fitgets "job_typ is not a valid configuration key" with no suggestion. bngsim answers a wrong name with the right one, and answers another tool's names with the call to use. - Getting started. No example ships in the wheel. The tutorial lessons in
examples/tutorialwould be ideal, since each fits data made from known parameters, but they exist only in the repository. - Running the right thing. A run with no terminal and an existing
output_dircrashes with EOFError (#1041). There is no way to check a configuration without starting the fit. - Knowing what it has. Results are spread over text files. Nothing says, in one place a program can read, what was fit, with which backend and seed, how the run ended, how many simulations failed, and what each file holds.
- Checking before reporting. Nothing tells the agent whether to trust the fit: whether the best fit sits on a bound, whether the starts agree, whether the objective value comes back when the best fit is run again.
- Acting from a shell.
pybnfhas one mode,-c CONF. Errors go to standard output, every failure exits 1, and there is no--version,--jsonor doctor command.
Proposed work. Each item can become its own issue.
Cheap, and each helps on its own:
- The PyPI description, README and module docstring say what PyBNF does now: the algorithms, the model formats, PEtab, gradient fitting, profile likelihood and the samplers. The README gets a section for AI agents.
- An agent guide for the installed version, inside the wheel:
pybnf.agent_guide(),pybnf guide, andpybnf skill --out FILEto write it as aSKILL.md. It covers a minimal edition 2 configuration, the rules that otherwise give wrong answers, what a refusal means, what needs what, a translation table from PEtab, pyPESTO, Data2Dynamics, COPASI and edition 1 keys, and how to check a fit. The test suite runs every configuration in it. -
llms.txtandllms-full.txton the docs site, reusing bngsim's Sphinx extension (docs/_ext/llms_txt.py). - A misspelled key, keyword or name gets its close matches (
job_typgetsjob_type). Keys from other tools get the edition 2 key to use. - A run with no terminal never prompts. It refuses with a message that names the directory and the flag to use (#1041).
-
pybnf --version.
Errors and results that a program can read:
- Every
PybnfErrorcarries a stablecode,details,remediesandto_dict(), with a generated page of codes, as bngsim's errors do. A bngsim error that PyBNF wraps keeps its code. - A results record,
Results/record.json: the PyBNF and bngsim versions, the configuration file and its hash, the edition,job_type, seed and backend of each model, the best fit and its objective value, why the run stopped, the number of evaluations and of failed simulations, every warning with a code, and what each file inResultsholds. - A progress file a program can poll during a long fit, so an agent does not have to read the log.
-
pybnf inspect CONF: load and resolve the configuration with the same checks a run makes, then report the job, the free parameters with their bounds and priors, the experiments and the model outputs their columns match, the backend of each model and why, and the simulation budget. It runs nothing.
Built on those:
- A check of a finished fit's
Resultsdirectory: parameters at a bound, agreement among starts, the objective value on a rerun of the best fit, the fraction of failed simulations, and for a stochastic fit the confirmation from #659. It needs a name other thancheck, whichjob_type = check(model checking) already uses. - Bundled examples:
pybnf exampleslists the tutorial lessons, andpybnf examples NAME --out DIRwrites one out with the parameters its data were made from. - Subcommands for the
pybnfcommand (doctor,guide,skill,examples,inspect,run), each with--json: one JSON object on standard output, an error as JSON on standard error, and an exit code for each outcome (usage error, configuration refused, run failed, budget or time limit reached).pybnf -c CONFkeeps working. -
pybnf doctor: the PyBNF and bngsim versions,bngsim.capabilities(), whetherBNG2.plis found and where, and which optional packages are installed (libRoadRunner, petab, dask, jax, arviz), with the fix for each one that is missing.
Measuring it. bngsim measures its version of this with agents in lanl/bngsim-benchmarks#17. A fitting task belongs in the same benchmark: give an agent a model and data, and score whether it reports the right best fit and says when the fit cannot be trusted.
A caution, carried over from lanl/bngsim#1710. Every item adds surface that has to stay right. The guide is tested by running it, the translation table by a test that pins it, and the JSON schema belongs to the command, so there is only one. An item that no test can keep right should not be built.
How this was checked. On 2026-11-27, with PyBNF 1.8.2 from main on macOS, a configuration with job_typ = fit exited 1 and printed "job_typ is not a valid configuration key" to standard output, with nothing on standard error. The bngsim features above come from its release/0.18.0 branch and from lanl/bngsim#1710.
- 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
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/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
Issue tương tự
-
Test: to_hijri() accepts datetime.datetime and uses only the date partCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở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 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
polish
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresCó thể đã có người làm @AshutoshSingh840 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
UKGovernmentBEIS/control-arena#992 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
mvalentsev/awesome-free-ai-coding#70 ·
Maintainer thường phản hồi trong vòng 1 ngày