You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is infection stratification flexible enough to current and future extensions #246
How will this work if we have i.e a reporting triangle or other form of data that can't be expressed in a matrix. It seems like we might need to generalise this/rework it so it takes dimensions at build time in some other more flexible way.
Noted while working through the current batch, recording where this stands rather than closing it.
The concrete constraint is that infection stratification is read off a matrix shape: _obs_data_shape derives n_strata from infection_strata applied to the observation stream count, which is the matrix's row count or the number of NamedTuple entries. A reporting triangle is neither, so it cannot state its stratum count that way.
This overlaps #326 (Aggregate cannot take a MissingObservations carrier), which is being fixed now. Both are cases of a component needing to describe its own data shape rather than have one inferred from an array's dimensions. Rather than open a design issue blind, I will report back after #326 lands on whether that work makes taking dimensions at build time cheap, or whether it needs its own change.
No action here for now.
This was opened by a bot. Please ping @seabbs for any questions.
The generalisation this asked for turned out to be smaller than a rework. The shape was already taken at build time; it was taken from the wrong place. _obs_data_shape read the stratum count off the data's array dimensions, which is right only where those dimensions are observation streams. A dense reporting triangle's rows are reference days and a BinomialError's N is a trials covariate, so both produced a stratified infection process nobody asked for and then failed with RandomWalk produces one path. Wrap it in a Stratify.
#363 adds observation_streams(model, y_t), the seam a component uses to say how many observation streams a data value holds for it, and resolves the shape from the chain's own declaration first, reading the data only for what the chain leaves open. It extends the data_requirements machinery rather than adding a parallel one.
No explicit dimensions slot was added to IDProblem. The build-time escape hatch already exists as as_turing_model(model, y_t, n) on IDModel, and the fault here was not a missing route but a wrong inference. Opened #364 for the IDProblem slot, should a case turn up that the seam cannot describe.
This was opened by a bot. Please ping @seabbs for any questions.
Activity
seabbs-bot commentedon Sep 2, 2026
Noted while working through the current batch, recording where this stands rather than closing it.
The concrete constraint is that infection stratification is read off a matrix shape:
_obs_data_shapederivesn_stratafrominfection_strataapplied to the observation stream count, which is the matrix's row count or the number ofNamedTupleentries. A reporting triangle is neither, so it cannot state its stratum count that way.This overlaps #326 (
Aggregatecannot take aMissingObservationscarrier), which is being fixed now. Both are cases of a component needing to describe its own data shape rather than have one inferred from an array's dimensions. Rather than open a design issue blind, I will report back after #326 lands on whether that work makes taking dimensions at build time cheap, or whether it needs its own change.No action here for now.
This was opened by a bot. Please ping @seabbs for any questions.
seabbs-bot commentedon Sep 4, 2026
Fixed in #363.
The generalisation this asked for turned out to be smaller than a rework. The shape was already taken at build time; it was taken from the wrong place.
_obs_data_shaperead the stratum count off the data's array dimensions, which is right only where those dimensions are observation streams. A dense reporting triangle's rows are reference days and aBinomialError'sNis a trials covariate, so both produced a stratified infection process nobody asked for and then failed withRandomWalk produces one path. Wrap it in a Stratify.#363 adds
observation_streams(model, y_t), the seam a component uses to say how many observation streams a data value holds for it, and resolves the shape from the chain's own declaration first, reading the data only for what the chain leaves open. It extends thedata_requirementsmachinery rather than adding a parallel one.No explicit dimensions slot was added to
IDProblem. The build-time escape hatch already exists asas_turing_model(model, y_t, n)onIDModel, and the fault here was not a missing route but a wrong inference. Opened #364 for theIDProblemslot, should a case turn up that the seam cannot describe.This was opened by a bot. Please ping @seabbs for any questions.