FE-1456: Add a usage manual for the Python bindings - #9266
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
PR SummaryLow Risk Overview The CLI usage manual “Driving the CLI from Python” section no longer teaches a hand-rolled Reviewed by Cursor Bugbot for commit 47caa60. Bugbot is set up for automated code reviews on this repo. Configure here. |
7dc0fdf to
09bbe8e
Compare
39ccc33 to
0bc4d8a
Compare
0bc4d8a to
b13e2d8
Compare
09bbe8e to
2c2733c
Compare
b13e2d8 to
109b220
Compare
2c2733c to
09ffabe
Compare
2047c0a to
55608c1
Compare
1d6951e to
b3f2cdb
Compare
b3f2cdb to
e38cccd
Compare
55608c1 to
4d92f94
Compare
4d92f94 to
eab8f6b
Compare
e38cccd to
28e11a0
Compare
eab8f6b to
524bc78
Compare
28e11a0 to
84dd0b8
Compare
|
Superseded by #9341. GitHub closed this PR when its base branch |
🌟 What is the purpose of this PR?
The CLI has a usage manual attached to its layer; the Python bindings had only a package README and docstrings. A caller who wants to drive Petrinaut from Python now has the same kind of guide in the docs site, attached to the
python-bindingslayer.FE-1415 (#9265) sits below in this stack and FE-1457 (#9267) above.
🔗 Related links
🔍 What does this change?
One new authored page,
content/python-bindings/usage-manual.mdx, covers depending on the package, opening a session, run requests, optimization studies, errors, timeouts and shutdown, with an end-to-end example. It documents the Python layer and links to the CLI manual for the protocol detail rather than repeating it. In the other direction, the CLI manual's "Driving the CLI from Python" section replaces its hand-written subprocess wrapper with a short example that uses the bindings.Every symbol, default and limit was checked against the source. Claims the package README implies, which the manual corrects:
PetrinautRunErrorextendsRuntimeErrordirectly; onlyPetrinautProtocolErrorextendsPetrinautClientErrorseedsPerTrialPETRINAUT_CHILD_NODE_OPTIONSis forwarded, as the child'sNODE_OPTIONSThe manual states each failure separately: a non-finite objective raises
PetrinautRunErrorand leaves the session usable; a non-numeric one fails schema validation and raisesPetrinautProtocolError; requestparamsthat fail JSON serialization raisePetrinautClientErrorbefore anything is written.close()may be called from another thread. The package's one runtime dependency is pydantic.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
🛡 What tests cover this?
lint:arch-docsvalidatesattachToand everydoc:/layer:target, so a stale link fails the build.❓ How to test this?
turbo run dev --filter @apps/petrinaut-docs/architecture/python-bindings/usage-manual: it appears under thepython-bindingslayer beside its Overview, and its links to the CLI manual resolve.🐾 Next steps
The CLI manual keeps its em dashes, so the two pages differ in punctuation style. Bringing the older page in line with the prose rules is a separate cleanup.
🤖 Generated with Claude Code