Skip to content

Default axis inheritance for states #48

@jc-macdonald

Description

@jc-macdonald

Summary

States should inherit all declared axes by default, with bracket syntax only needed for asymmetric (per-state) overrides.

Problem

Currently every state gets an empty axis set unless explicitly listed in state_axes. This means a model with 3 axes and 5 states requires a state_axes block mapping every state to every axis, even when they all share the same structure. The talk and proposed spec syntax show bare state: [S, E, I, R] with the expectation that all states expand over all declared axes automatically.

Proposed Behavior

  1. Default: All states inherit all declared axes (full Cartesian product).
  2. Override via bracket syntax: S[age] means S only carries the age axis. I[age,strain] means I carries both. A bare S means "inherit all axes."
  3. Explicit state_axes: Still supported as an alternative to bracket syntax for backward compatibility.
  4. Interaction with constraints (Add axis masking to avoid empty compartments #31/Constraint filtering for state, alias, and transition expansion #37): Default inheritance + constraints gives the same effect as asymmetric membership but with less boilerplate.

Proposed Syntax

spec:
  axes:
    - {name: age, type: continuous, coords: [0, 5, 18, 50, 65, 100]}
    - {name: vax, coords: [unvaccinated, 1dose, waned]}
  # All states get both axes by default:
  state: [S, E, I, R]

  # Or override per-state:
  state: [S[age,vax], E[age,vax], I[age,vax,strain], R[age]]

Scope

  • When no state_axes block and no bracket syntax: every state inherits all axes
  • Parse bracket syntax in state list entries to extract per-state axis overrides
  • Validate bracket axis references against declared axes
  • Preserve backward compatibility with explicit state_axes block
  • Update tests and documentation

Related

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions