Skip to content

Index reaction targets with their own axis order - #185

Merged
jc-macdonald merged 2 commits into
mainfrom
feat/184-to-full-axes
Oct 2, 2026
Merged

jc-macdonald merged 2 commits into
mainfrom
feat/184-to-full-axes

Conversation

@jc-macdonald

Copy link
Copy Markdown
Member

Stacked on #183. It also needs op_system #249 and #250. The development pins point at the head of op_system #250 while those await review. Once they merge, I'll rebase this, retarget it to main, and move the pins to the merge commits.

op_system #250 publishes reactions whose source and target templates have different axes: scalar S→I→R models, axis-less donors depositing into a pinned cell (I -> X[imm=x1]), and templated sources collapsing into an axis-less state (X[imm] -> R). full_axes is the source's axis order. The compiler registered both templates with it and rejected these reactions with a shape mismatch. op_system now publishes the target's order as to_full_axes.

Closes #184.

Behavior

  • Target layout: to_base is registered with to_full_axes. Artifacts without the field fall back to full_axes.
  • Coverage checks: channel and donor coverage are checked against the source template, or the target for a source-only reaction. Destination coverage, including offsets, is checked against the target template.

Coverage

  • Stoichiometry and drift reconstruction for scalar SIR, scalar → pinned cell, and templated → scalar, under NumPy and JAX.
  • Artifacts without to_full_axes produce the same network as before.
  • Ensemble: 400 seeded direct-SSA runs of an axis-less pure-death process. At three observation times, survivor means and variances match Binomial(20, e^(−μt)) within five standard errors. The variance tolerance uses the binomial fourth central moment, and every path conserves its total.
  • Scalar SIR runs in direct SSA with integer, conserved populations.

Docs

  • Provider README, Stochastic reaction networks: how axis-less states participate, and target indexing.
  • CHANGELOG entry under Unreleased.

Validation

  • just ci: 592 core tests passed, 2 skipped. 368 provider tests passed (9 new). Ruff and strict mypy passed for both packages.
  • just docs: strict documentation build passed.

Two commits: 271 and 12 changed lines.

🤖 Generated with Claude Code

jc-macdonald and others added 2 commits October 2, 2026 19:03
op_system #250 publishes reactions whose source and target templates
have different axes: scalar S->I->R models, axis-less donors depositing
into a pinned cell, and templated sources collapsing into an axis-less
state. The network compiler registered both templates with full_axes,
the source's order, and rejected these with a shape mismatch.

Register the target with to_full_axes (falling back to full_axes for
older artifacts), and check channel and donor coverage against the
source template and destination coverage against the target. Advance
the development op_system pins to the head of #250.

Refs #184

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #184

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jc-macdonald
jc-macdonald force-pushed the feat/184-to-full-axes branch from 8ac8706 to 24b3bc9 Compare October 2, 2026 23:03
@jc-macdonald
jc-macdonald changed the base branch from feat/182-stochastic-coverage to main October 2, 2026 23:03
@jc-macdonald
jc-macdonald merged commit 41c0e6a into main Oct 2, 2026
6 checks passed
@jc-macdonald
jc-macdonald deleted the feat/184-to-full-axes branch October 2, 2026 23:15
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.

Consume reactions between templates with different axes (to_full_axes)

1 participant