Skip to content

Fix python typing plus a whole host of other issues discovered in the process. - #1485

Merged
luciansmith merged 3 commits into
developfrom
issue-1422-python-typing
Dec 3, 2026
Merged

luciansmith merged 3 commits into
developfrom
issue-1422-python-typing

Conversation

@luciansmith

Copy link
Copy Markdown

Builds off of @matthiaskoenig 's proposal, but generates what it can of the typing file from swig, instead of hard-coding everything.

Also, a ton of bug fixes, mostly stemming from un-skipping a bunch of python tests.

matthiaskoenig and others added 3 commits November 25, 2026 23:42
Add complete Python API typing and ty checks
We still hard-code a bunch of things that SWIG can't generate yet, but we generate what we can, which makes this approach more future-proof.  Generation is from 'complete_stub.py'.

Other fixes/changes:
* Slicing now keeps row/column names, as does vstack/hstack/concatenate.  If the labels conflict, that's an error; if one is there and the other is missing, we perform the join and un-label the result.
* More variants of python types can now be used in our functions.  Among other things, this fixes #1301.
* 'long' -> 'long long' is now correct.
* Requires new rr-libstruct, with zero-sized matrices now not causing crashes.
* Also, a bunch of skipped python tests are now unskipped.  Among other things, this involved adding new 'get' functions for getBoundary, getConstant, getReversible, getPersistent, and getTriggerInitialValue.
* setConstant now works on species references.
* Loading a document with no model no longer crashes; it throws or adds an empty model appropriately.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BCWJVGVzVqYawshjJodZN
@luciansmith
luciansmith merged commit 917df1d into develop Dec 3, 2026
81 of 127 checks passed
@luciansmith
luciansmith deleted the issue-1422-python-typing branch December 3, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants