feat: add coord_shift transition type#66
Merged
jc-macdonald merged 1 commit intomainfrom Apr 21, 2026
Merged
Conversation
Introduce coord_shift entries in the transitions list that expand into
concrete from/to/rate transitions by shifting one axis coordinate for
a set of apply_to states.
Example:
coord_shift: {vax: u -> v}
apply_to: [S, R]
rate: nu
expands to S__vax_u->S__vax_v and R__vax_u->R__vax_v transitions.
Multi-axis states expand over all non-shifted axis coordinates.
Adds _validate_coord_shift_entry, _apply_coord_shifts, and
_expand_coord_shift_for_base helpers with 8 new tests covering
happy paths, multi-axis expansion, and validation errors.
TimothyWillard
approved these changes
Apr 20, 2026
pearsonca
reviewed
Apr 20, 2026
Member
pearsonca
left a comment
There was a problem hiding this comment.
Seems conceptually fine, but: what's the plan for expressing non-categorical shifts?
Collaborator
Author
for continuous shifts the natural thing is an advection operator - I have an issue for that already on op_engine, ACCIDDA/op_engine#59 |
Member
|
Seems fine for now - I do think we want to have conceptual consistency in the configuration DSL expression for change in e.g. vaccine status and change in e.g. age, whatever is going on under the hood. break-break, we'll want some simplified expression for initial conditions by axes as well |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #47
Summary
Introduces
coord_shiftentries in the transitions list as a concise way to specify axis-coordinate-shifting transitions across a set of states.What changed
coord_shift: instead of writing individualfrom/totransitions for every state and every non-shifted axis combination, a singlecoord_shiftentry expands to all concrete transitions automatically.transitions_rawbefore template expansion — so the generated transitions are treated identically to any hand-written concrete transition.apply_tomust be a non-empty list,ratemust be a string, all target states must already exist in the expanded state list.Example
Expands to:
For states with additional axes, transitions are emitted for each combination of the non-shifted axis coordinates.
Tests
8 new tests:
apply_to, missingrate, malformed arrow syntax