Time-varying-load RegressionNode (#37), surpyval 0.16, and 0.8.0 docs - #66
Merged
derrynknife merged 3 commits intoJul 22, 2026
Merged
Conversation
RegressionNode now accepts a `schedule=` (a surpyval StepSchedule) as an alternative to a fixed `covariates` vector. When the load a component runs under varies over its life, reliability is the exact survival along that covariate path via `model.sf_tvc(x, schedule)`, rather than `model.sf(x, Z)` at a single operating point. This is the load-dependent-aging / digital-twin node of issue #37, re-scoped to reuse the existing RegressionNode rather than a bespoke exposure/virtual-age class: the covariate path IS the load history, and surpyval owns the survival-under-a-path computation. Conditioning on `age` needs no special handling in the condition-based layer, because `sf_tvc(age + x) / sf_tvc(age)` is exactly surpyval's `sf_tvc(..., given=age)` — the go-forward reliability from the component's current life under the schedule. Works for accelerated-failure-time and proportional-/additive-hazards families; proportional-odds does not compose along a covariate path and is rejected at construction. The schedule persists through serialisation (change-point / interval schedules; cyclic schedules not yet serialisable). Exactly one of `covariates` or `schedule` must be given. The schedule-mode tests are skipped on surpyval builds that predate `sf_tvc`, so CI stays green until that ships to PyPI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NUGaeQXKxjjiQ1ULT1ApXS
surpyval 0.16.0 publishes `sf_tvc` / `StepSchedule` to PyPI, so the RegressionNode schedule mode added in the previous commit now has a real released dependency. Bump the floor from >=0.15,<0.16 to >=0.16,<0.17. This also fixes CI: against the older PyPI surpyval (which lacked `StepSchedule`), mypy flagged `regression_node.py` importing `StepSchedule` as an undefined attribute, and the schedule tests skipped (leaving that code path uncovered). On 0.16 the attribute resolves and the eight schedule tests run — verified locally with the pinned mypy 2.3.0 and the full suite (coverage 91%). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NUGaeQXKxjjiQ1ULT1ApXS
The how-to guide and API reference already covered load sharing, common-cause failures, and covariate/time-varying reliability, but the theory page and the end-to-end tutorial did not. Fill both gaps ahead of the release. Concepts gains three sections: - Covariate-dependent and time-varying reliability (sf(x, Z), the survival- along-a-path sf_tvc, the age-conditioning identity, and which families compose along a covariate path). - Dependent failures: load sharing (the cumulative-exposure / virtual-age model, the hypoexponential closed form, and the phi == 1 reduction to k-of-n). - Common-cause failures (beta-factor and MGL, the basic-event probability, and the exact shock-conditioning that makes beta = 0 reproduce independence). The tutorial gains a worked "dependent failures" step on the same pumping skid: the pumps modelled as a load-sharing pair, a beta-factor common cause on the identical filters, and one component under a ramping duty schedule. Every cited number is computed from the actual models. Later steps renumber accordingly, and the landing-page and tutorial "where to next" blurbs now point at the new theory. Also fixes the CHANGELOG: the surpyval-requirement "Changed" note had been inserted between the Added bullets, so the LoadSharingModel and CCF entries were sitting under Changed; they move back under Added, and a Documentation note is added. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NUGaeQXKxjjiQ1ULT1ApXS
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.
Summary
Completes the 0.8.0 payload on top of the already-merged load-sharing (#38) and
common-cause (#44) work:
RegressionNode(AFT exposure model for RBD nodes (load-dependent aging) #37). Adds aschedule=mode: acomponent's covariates can follow a piecewise-constant path (a surpyval
StepSchedule), and reliability is the exact survival along that path(
model.sf_tvc). Age-conditioning needs no special case, sincesf_tvc(age + x) / sf_tvc(age)is exactlysf_tvc(..., given=age)— thego-forward reliability from the component's current life under the schedule.
Works for accelerated-failure-time and proportional-/additive-hazards
families; proportional-odds does not compose along a path and is refused at
construction. Serialises with the RBD.
sf_tvc,published in 0.16.0; the floor moves from
>=0.15,<0.16to>=0.16,<0.17.time-varying reliability, load sharing, and common-cause failures; the
tutorial gains a worked "dependent failures" step exercising all three on the
pumping skid (every cited number computed from the actual models).
Type of change
Checklist
sfvssf_tvc(AFT/PH), condition-basedgiven, serialisation round-trips, PO rejection, mean/randomblack,isort,flake8, andmypypass (verified with the pinnedmypy==2.3.0against surpyval 0.16.0)coverage run -m pytestpasses and stays above the coverage gate (91%)CHANGELOG.mdupdated under[Unreleased](Added AFT exposure model for RBD nodes (load-dependent aging) #37; Changed surpyval floor; Documentation note)Notes for reviewers
master; this PR is the remaining AFT exposure model for RBD nodes (load-dependent aging) #37 increment plus the 0.8.0 doc coverage for all three features.>=0.16because schedule mode needssf_tvc(published in 0.16.0). While the branch briefly built against the pre-0.16 PyPI surpyval,mypycould not resolveStepScheduleand the schedule tests skipped; the pin fixes both. Green end-to-end ated2e8a2(lint, test 3.11/3.12, docs strict).🤖 Generated with Claude Code
https://claude.ai/code/session_01NUGaeQXKxjjiQ1ULT1ApXS
Generated by Claude Code