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
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 26
- 派生
- 25
- 平均合并
- 4 小时 25 分钟
- 30 天内合并 PR
- 9
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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
难度 2/5 1-3 小时 新手友好度 85/100
-
bug minor
难度 1/5 1-3 小时 新手友好度 92/100
-
bug minor
难度 2/5 1-3 小时 新手友好度 76/100
相似的 Issue
-
Test: to_hijri() accepts datetime.datetime and uses only the date part可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭good first issue
难度 1/5 1 小时以内 新手友好度 95/100
omarelshamy25x/shamy-hijri#63 · 3 条评论 ·
维护者通常 1 天内回复
-
polish
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scores可能已有人在做 @AshutoshSingh840 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
UKGovernmentBEIS/control-arena#992 ·
维护者通常 3 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
mvalentsev/awesome-free-ai-coding#70 ·
维护者通常 1 天内回复