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
Expose core composition infrastructure as public API for extensibility #184
From #76 review (src/latent_models/models/MA.jl:66).
We need good support for users extending the package with new components, so core infrastructure can't live in private (underscore) functions. We should review, try to simplify, rename, and expose the bits that custom-component authors need as public API — and add these to the 'writing custom components' docs.
(Relates to #76's _at, as_turing_submodel, the accumulation-step machinery, etc.)
From @seabbs review of #76. This was opened by a bot. Please ping @seabbs for any questions.
PR #282 makes the prior-slot widening seam a custom component's constructor
and recursion call directly public (documented, not exported):
at(p, t) — read a possibly time-varying parameter at step t
path_prior(p) — widen a raw prior into a length-n PATH prior
prior_order(p) — the order (p/q/d) implied by a prior slot
assert_prior_length(p, k, what) — check a vector slot's length
matching the level already set for ModelShape/across_shape/ infection_strata/AbstractAccumulationStep. The old _-prefixed names
are kept working as aliases, so this is non-breaking. All four now have
docstrings (previously only _at did).
The renewal step/modifier half of this (AbstractRenewalModifier, modifier_init_state, apply_modifier, the composed RenewalStep) was
already made public by #245, and the Renewal constructor already takes
modifiers directly — see the comment just posted on #173.
Deliberately left private: _ErrorDist/_TrialDist — internal performance
structs coupled to the built-in observation-error models' own scoring loops,
not part of the seam a new component composes against.
Not done by this PR, so leaving this open rather than closing: the "writing
custom components" doc page this issue also asks for, that would gather
these newly-public names (and as_turing_submodel, the accumulation-step
machinery already public) into one extension-focused tutorial. That's a
docs-writing task on its own, separate from the API-surface change here.
This was commented on by a bot. Please ping @seabbs for any questions.
Re-checked against main at 1a3e485 (after #282 merged). Half of this is done, the other half is not, so it stays open on the documentation ask.
Met — the underscore helpers are public API.#282 renamed _at, _path_prior, _prior_order and _assert_prior_length to at, path_prior, prior_order and assert_prior_length, gave all four docstrings, and declared them public (src/ComposableTuringIDModels.jl:142). The old names are kept as aliases of the same generic function, so nothing breaks. Confirmed on main: Base.ispublic is true for all four.
These sit alongside the extension points already public before this round: ModelShape, across_shape, infection_strata, AbstractAccumulationStep, the renewal step and modifier interfaces, and MissingObservations. as_turing_submodel is exported.
Not met — the docs page. This issue asks for these to be added to a "writing custom components" page. There is no such page. docs/src contains overview.md, design.md, getting-started/ and tutorials/, and grepping docs/src for "custom component" and "writing your own" returns nothing. #282 says so in its own body rather than claiming otherwise.
One judgement worth recording.#282 deliberately left _ErrorDist and _TrialDist private, on the grounds that they are internal performance structs coupled to the built-in error models' scoring loops rather than part of the seam a new component composes against. That is a defensible line but it is a decision, not a completed item, so it is worth confirming when the docs page is written.
Left open for the "writing custom components" page.
This was written by a bot. Please ping @seabbs for any questions.
Activity
seabbs-bot commentedon Aug 18, 2026
PR #282 makes the prior-slot widening seam a custom component's constructor
and recursion call directly
public(documented, not exported):at(p, t)— read a possibly time-varying parameter at steptpath_prior(p)— widen a raw prior into a length-nPATH priorprior_order(p)— the order (p/q/d) implied by a prior slotassert_prior_length(p, k, what)— check a vector slot's lengthmatching the level already set for
ModelShape/across_shape/infection_strata/AbstractAccumulationStep. The old_-prefixed namesare kept working as aliases, so this is non-breaking. All four now have
docstrings (previously only
_atdid).The renewal step/modifier half of this (
AbstractRenewalModifier,modifier_init_state,apply_modifier, the composedRenewalStep) wasalready made public by #245, and the
Renewalconstructor already takesmodifiers directly — see the comment just posted on #173.
Deliberately left private:
_ErrorDist/_TrialDist— internal performancestructs coupled to the built-in observation-error models' own scoring loops,
not part of the seam a new component composes against.
Not done by this PR, so leaving this open rather than closing: the "writing
custom components" doc page this issue also asks for, that would gather
these newly-public names (and
as_turing_submodel, the accumulation-stepmachinery already public) into one extension-focused tutorial. That's a
docs-writing task on its own, separate from the API-surface change here.
This was commented on by a bot. Please ping @seabbs for any questions.
feat(base): make prior-widening helpers public API (#173, #184) (#282)
seabbs-bot commentedon Aug 20, 2026
Re-checked against
mainat 1a3e485 (after #282 merged). Half of this is done, the other half is not, so it stays open on the documentation ask.Met — the underscore helpers are public API. #282 renamed
_at,_path_prior,_prior_orderand_assert_prior_lengthtoat,path_prior,prior_orderandassert_prior_length, gave all four docstrings, and declared thempublic(src/ComposableTuringIDModels.jl:142). The old names are kept as aliases of the same generic function, so nothing breaks. Confirmed onmain:Base.ispublicis true for all four.These sit alongside the extension points already public before this round:
ModelShape,across_shape,infection_strata,AbstractAccumulationStep, the renewal step and modifier interfaces, andMissingObservations.as_turing_submodelis exported.Not met — the docs page. This issue asks for these to be added to a "writing custom components" page. There is no such page.
docs/srccontainsoverview.md,design.md,getting-started/andtutorials/, and greppingdocs/srcfor "custom component" and "writing your own" returns nothing. #282 says so in its own body rather than claiming otherwise.One judgement worth recording. #282 deliberately left
_ErrorDistand_TrialDistprivate, on the grounds that they are internal performance structs coupled to the built-in error models' scoring loops rather than part of the seam a new component composes against. That is a defensible line but it is a decision, not a completed item, so it is worth confirming when the docs page is written.Left open for the "writing custom components" page.
This was written by a bot. Please ping @seabbs for any questions.