Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
5d247e2
Merge pull request #453 from derrynknife/main
derrynknife Nov 16, 2026
f8e0dcb
Add a discount rate to the long-run replacement policies (Fox, 1966)
derrynknife Nov 16, 2026
bff6c0c
Merge pull request #454 from derrynknife/feat/discounted-long-run
derrynknife Nov 16, 2026
90d1138
Opportunities with the prices on the part (UC-45)
derrynknife Nov 16, 2026
c4d40d2
Merge pull request #455 from derrynknife/feat/opportunity-prices
derrynknife Nov 16, 2026
24fe8b8
Exact by default, refused with a ready horizon, horizon= never refuse…
derrynknife Nov 16, 2026
5708539
Merge pull request #456 from derrynknife/feat/npv-exact-or-horizon
derrynknife Nov 16, 2026
613e509
Make discount_rate keyword-only on the age-replacement optimisers
derrynknife Nov 16, 2026
898b82d
Merge pull request #457 from derrynknife/fix/discount-rate-keyword-only
derrynknife Nov 16, 2026
5065681
Overhaul/replace optimiser compares against never-replace and failure…
derrynknife Nov 20, 2026
7859d33
Merge pull request #458 from derrynknife/build/ohr-compare
derrynknife Nov 20, 2026
4a1547c
Add npv_distribution: the net present value of each simulated run
derrynknife Nov 20, 2026
370e799
Merge remote-tracking branch 'origin/dev' into build/npv-sim-1
derrynknife Nov 20, 2026
9293f7d
Merge pull request #459 from derrynknife/build/npv-sim-1
derrynknife Nov 20, 2026
0605b8b
Add availability contracts and compare_npv to the simulated NPV
derrynknife Nov 20, 2026
433da18
Merge pull request #460 from derrynknife/build/npv-sim-2
derrynknife Nov 20, 2026
1f2839b
Add RepairableRBD.best_switch_time: the best time to switch a diagram…
derrynknife Nov 20, 2026
7f99117
Merge remote-tracking branch 'origin/dev' into build/running-hot
derrynknife Nov 20, 2026
aafb18a
Merge pull request #461 from derrynknife/build/running-hot
derrynknife Nov 20, 2026
4a99a98
Price repair crews: crew_cost_rate, a salary per crew per unit time
claude Nov 20, 2026
033c4e1
Present values on the calendar forecasts (schedule)
claude Nov 20, 2026
86d0aef
Merge pull request #462 from derrynknife/build/crew-salaries
derrynknife Nov 20, 2026
5d0c1ec
Merge dev into build/calendar-npv
claude Nov 20, 2026
17117b8
Merge pull request #463 from derrynknife/build/calendar-npv
derrynknife Nov 20, 2026
32385b9
Write the use case for a replacement task's value against running to …
claude Nov 20, 2026
647fd12
Add task_value: a replacement task against running to failure on dates
claude Nov 20, 2026
630a462
Merge pull request #464 from derrynknife/build/task-value
derrynknife Nov 20, 2026
17e8fcb
Choose replacement intervals for an equivalent annual cost or a net p…
claude Nov 20, 2026
f200fc4
Decision diagrams: an order that looks a node ahead, and a benchmark
claude Nov 20, 2026
1c165c0
Merge dev into build/npv-objective
claude Nov 20, 2026
752b149
Merge remote-tracking branch 'origin/dev' into build/bdd-scaling
claude Nov 20, 2026
40ad93c
Replace a component at a list of times: "replace_at" on a preventive …
claude Nov 20, 2026
20464f1
Add a call-out crew: one more repair crew called when jobs queue
claude Nov 20, 2026
10dae9e
Merge remote-tracking branch 'origin/dev' into build/callout-crew
claude Nov 20, 2026
2a0ac6f
Merge pull request #466 from derrynknife/build/bdd-scaling
derrynknife Nov 20, 2026
91f60ba
Merge pull request #465 from derrynknife/build/npv-objective
derrynknife Nov 20, 2026
bb71436
Choose test intervals for an equivalent annual cost or a net present …
claude Nov 20, 2026
f5ecd85
Merge pull request #467 from derrynknife/build/npv-inspection
derrynknife Nov 20, 2026
0325274
Value outages at given times without simulation
claude Nov 20, 2026
cd723cc
Choose redundancy by net present value or equivalent annual cost
claude Nov 20, 2026
f3bb688
Merge pull request #468 from derrynknife/build/npv-allocation
derrynknife Nov 20, 2026
3fb8af4
Merge dev into build/npv-renewals
claude Nov 20, 2026
6b41cdb
Merge pull request #469 from derrynknife/build/npv-renewals
derrynknife Nov 20, 2026
3c7a5c6
Merge dev into build/npv-outages
claude Nov 20, 2026
50783df
Merge remote-tracking branch 'origin/dev' into build/callout-crew
claude Nov 20, 2026
d71297c
Merge pull request #470 from derrynknife/build/callout-crew
derrynknife Nov 20, 2026
c468a4f
Value mid-life upgrades, retirement and salvage in a net present value
claude Nov 20, 2026
09d5547
Dated shuts on a diagram are worked out over a horizon: the schedule'…
claude Nov 20, 2026
6c10fb0
Merge remote-tracking branch 'origin/dev' into build/npv-outages
claude Nov 20, 2026
b865708
Take common-cause groups into the repair crews' Markov chain
claude Nov 20, 2026
01888ec
Merge pull request #471 from derrynknife/build/crews-ccf
derrynknife Nov 20, 2026
8e4bee9
Merge pull request #472 from derrynknife/build/npv-outages
derrynknife Nov 20, 2026
97438f4
Merge remote-tracking branch 'origin/dev' into build/npv-upgrades
claude Nov 20, 2026
36e4492
Merge pull request #473 from derrynknife/build/npv-upgrades
derrynknife Nov 20, 2026
4e30c46
Allocate redundancy with limited repair crews
claude Nov 20, 2026
3632f1f
Merge remote-tracking branch 'origin/dev' into build/crews-allocation
claude Nov 20, 2026
7d4c031
Merge pull request #474 from derrynknife/build/crews-allocation
derrynknife Nov 20, 2026
a666893
Bring three tests and a guide example up to date with dev
claude Nov 20, 2026
8d03bee
State the constant-rate task value test's tolerance from the grid
claude Nov 20, 2026
264e3e6
Merge pull request #475 from derrynknife/build/dev-fixes
derrynknife Nov 20, 2026
d249b5d
Value a test of a hidden failure: over a window, and on dates
claude Nov 20, 2026
36ab578
Merge pull request #476 from derrynknife/build/inspection-value
derrynknife Nov 20, 2026
045975e
Say how sure an NPV and a choice of intervals are
claude Nov 20, 2026
f40801d
Merge pull request #477 from derrynknife/build/npv-uncertainty
derrynknife Nov 20, 2026
86048d6
Renew parts opportunistically at a planned outage
claude Nov 20, 2026
c1d14da
Merge pull request #478 from derrynknife/build/outage-opportunistic
derrynknife Nov 20, 2026
31ca337
Value and prices over time in a net present value
claude Nov 20, 2026
a21d2d1
Merge pull request #479 from derrynknife/build/npv-escalation
derrynknife Nov 20, 2026
08fe398
Restore a part to a given age in a task
claude Nov 20, 2026
cb85737
Merge pull request #480 from derrynknife/build/restore-to-age
derrynknife Nov 20, 2026
363cef8
Renew a part at several shutdowns
claude Nov 21, 2026
cc198f2
Merge pull request #481 from derrynknife/build/shutdowns-several
derrynknife Nov 21, 2026
55f214f
Simulate an upgraded component
claude Nov 21, 2026
91281a2
Merge pull request #482 from derrynknife/build/simulate-upgrades
derrynknife Nov 21, 2026
a071169
Block replacement on an upgraded component
claude Nov 21, 2026
14dac92
Merge pull request #483 from derrynknife/build/upgrade-maintenance
derrynknife Nov 21, 2026
eb88d61
Ask and answer an NPV question as JSON
claude Nov 21, 2026
7109df5
Merge pull request #484 from derrynknife/build/npv-contract
derrynknife Nov 21, 2026
4dc566e
Price simulated runs with shutdowns
claude Nov 21, 2026
5ffca9c
Merge pull request #485 from derrynknife/build/npv-shutdowns
derrynknife Nov 21, 2026
891f55c
Common causes for wear-out lives and ages: rate-split groups at one a…
claude Nov 21, 2026
54addc0
Follow the README row's new title in the routes test
claude Nov 21, 2026
a5435c6
Merge dev
claude Nov 21, 2026
6874081
Merge pull request #486 from derrynknife/build/ccf-guide
derrynknife Nov 21, 2026
ba4fa3b
A value schedule and escalation in simulated runs and logs
claude Nov 21, 2026
bbcc74b
Merge dev
claude Nov 21, 2026
0f6f05e
Shocks that fail each member with a probability, written out as nodes
claude Nov 21, 2026
40ae27f
Merge pull request #487 from derrynknife/build/ccf-shocks
derrynknife Nov 21, 2026
8519247
Give money one home: repyability.value
claude Nov 21, 2026
042b175
Merge origin/dev into build/value-module
claude Nov 21, 2026
01d946a
Merge pull request #488 from derrynknife/build/value-module
derrynknife Nov 21, 2026
d3787b4
Let a preventive task do harm: a restoration factor above 1
claude Nov 21, 2026
4b52d85
Shocks: shocks at a rate of their own as a common-cause group's model
claude Nov 21, 2026
3b2c65a
Merge remote-tracking branch 'origin/dev' into build/shocks-model
claude Nov 21, 2026
c1e3869
Merge pull request #489 from derrynknife/build/harmful-maintenance
derrynknife Nov 21, 2026
6d2ac73
Merge dev
claude Nov 21, 2026
2515d7c
Merge dev
claude Nov 21, 2026
11b0ad1
Merge pull request #490 from derrynknife/build/shocks-model
derrynknife Nov 21, 2026
2a52e16
Merge dev
claude Nov 21, 2026
1f2623e
Merge pull request #491 from derrynknife/build/npv-value-runs
derrynknife Nov 21, 2026
7d29950
Shocks in a repairable diagram: simulated, for members of any lives
claude Nov 21, 2026
600a425
Replace a stale crews test: allocation with crews is no longer refused
claude Nov 21, 2026
9a4df97
Merge pull request #492 from derrynknife/claude/clever-einstein-8rueu3
derrynknife Nov 21, 2026
c30c4be
A unit's maintenance plan as one object a node takes: UnitPlan
claude Nov 21, 2026
0a57fe7
Value a block kept unless due at outages at given times stretch by st…
claude Nov 21, 2026
8091a1f
Register the plan as a repairable node; ValueSchedule is not a node
claude Nov 21, 2026
2c57ad4
Merge remote-tracking branch 'origin/dev' into build/maintenance-plan
claude Nov 21, 2026
7bca001
Merge pull request #493 from derrynknife/build/maintenance-plan
derrynknife Nov 21, 2026
49ec2e4
Merge dev
claude Nov 21, 2026
8f0573a
Run each unit on its own duty plan on the calendar
claude Nov 21, 2026
baaa39c
Say in the constructor what a duty plan that changes does
claude Nov 21, 2026
e4f2a85
Merge pull request #494 from derrynknife/build/calendar-engine
derrynknife Nov 21, 2026
5856eb3
Give the long run of a diagram with an upgrade: the diagram once upgr…
claude Nov 21, 2026
167f19a
Merge dev
claude Nov 21, 2026
2a474a1
Satisfy mypy: test the last stretch's grid on last_like itself
claude Nov 21, 2026
a15325c
Merge dev
claude Nov 21, 2026
e45c98b
Value a unit's plan alone, with its own salvage, growth and retirement
claude Nov 21, 2026
bf9120a
Merge pull request #495 from derrynknife/build/kept-at-given-times-2
derrynknife Nov 21, 2026
7c17789
Merge dev
claude Nov 21, 2026
fa20e06
Draw one seed for every run of an unseeded cost by window
claude Nov 21, 2026
36b9665
Merge remote-tracking branch 'origin/dev' into build/unseeded-costs
claude Nov 21, 2026
e8b9d52
Merge pull request #497 from derrynknife/build/unseeded-costs
derrynknife Nov 21, 2026
98ec207
Merge dev
claude Nov 21, 2026
65be205
Merge pull request #496 from derrynknife/build/upgrade-long-run
derrynknife Nov 21, 2026
1e2dd79
Merge origin/dev into build/plan-alone
claude Nov 21, 2026
b7a69cc
Merge dev
claude Nov 21, 2026
9e6ecb4
Merge pull request #498 from derrynknife/build/plan-alone
derrynknife Nov 21, 2026
c4a05b1
Refuse a shocked member's own long-run availability and exact spares
claude Nov 21, 2026
877d845
A diagram as a unit's life: NonRepairableRBD.qf and taking it by its …
claude Nov 21, 2026
70f38b6
Merge origin/dev into build/diagram-life
claude Nov 21, 2026
c55970a
Merge dev
claude Nov 21, 2026
503c185
Lint the diagram-life test
claude Nov 21, 2026
cde2e25
Merge pull request #499 from derrynknife/build/diagram-life
derrynknife Nov 21, 2026
969eb06
Merge dev
claude Nov 21, 2026
ba6189b
Merge pull request #500 from derrynknife/build/shocks-repairable
derrynknife Nov 21, 2026
de28b34
Plain preventive and inspection durations; n_draws refuses mc_samples…
claude Nov 21, 2026
fa39695
Merge remote-tracking branch 'origin/dev' into build/usertest-friction
claude Nov 21, 2026
24125a8
Merge pull request #501 from derrynknife/build/usertest-friction
derrynknife Nov 21, 2026
bdd0d9f
Write the maintenance and money layering down
claude Nov 21, 2026
ec1a8b5
One discounted EAC of age replacement; value_plan takes a unit's plan
claude Nov 21, 2026
6578802
Merge origin/dev into build/one-eac
claude Nov 21, 2026
380fd77
Merge pull request #502 from derrynknife/build/one-eac
derrynknife Nov 21, 2026
5f7300f
Merge origin/dev into build/layering
claude Nov 21, 2026
b3037a1
Merge pull request #503 from derrynknife/build/layering
derrynknife Nov 21, 2026
e5ca604
Value a service on dates: no effect by default, or a stated effect
claude Nov 21, 2026
e636b52
Merge pull request #504 from derrynknife/build/service-value
derrynknife Nov 21, 2026
49c6bb7
The least spend that keeps a bad run's downtime under a limit
claude Nov 21, 2026
6ae1a77
Merge pull request #505 from derrynknife/build/downtime-risk
derrynknife Nov 21, 2026
8d25e55
Document UnitPlan, its tasks and CalendarContext in the API reference
claude Nov 21, 2026
65f4490
Merge pull request #506 from derrynknife/build/task-docs
derrynknife Nov 21, 2026
0bae2bb
Draw a multi-run result's unseeded seed from numpy's global RNG
claude Nov 21, 2026
813c390
Merge pull request #507 from derrynknife/build/shared-seed
derrynknife Nov 21, 2026
c4a7363
Take the site's Opportunities as a diagram's shutdowns
claude Nov 21, 2026
43d4203
Credit a unit's own salvage and retirement in simulated runs
claude Nov 21, 2026
9629eab
Merge pull request #508 from derrynknife/build/one-shutdown-model
derrynknife Nov 21, 2026
ea2617f
Merge origin/dev into build/own-end-in-runs
claude Nov 21, 2026
a6f79bb
Merge pull request #509 from derrynknife/build/own-end-in-runs
derrynknife Nov 21, 2026
a499002
Discount a schedule forecast's costs from when they fall
claude Nov 21, 2026
5f54b64
Keep a period with no running at exactly nothing
claude Nov 21, 2026
5fb0df0
Credit a unit's own salvage and retirement in switch times, logs and …
claude Nov 21, 2026
48b2037
Merge pull request #511 from derrynknife/build/own-end-switch
derrynknife Nov 21, 2026
84b3741
Count the expected failures' own error in a forecast's npv_precision
derrynknife Nov 22, 2026
39e2935
Merge origin/dev into build/time-changed-curves
derrynknife Nov 22, 2026
295e7db
Record UC-48's stated precision with the count's error
derrynknife Nov 22, 2026
a6d4c6c
Merge pull request #510 from derrynknife/build/time-changed-curves
derrynknife Nov 22, 2026
6027c97
Let the redundancy search take start_probability
derrynknife Nov 22, 2026
cb97239
Merge pull request #512 from derrynknife/build/allocation-start-proba…
derrynknife Nov 22, 2026
c8dab6d
Take surpyval's model classes from their subpackages
derrynknife Nov 22, 2026
c5e5311
Merge pull request #513 from derrynknife/build/surpyval-subpackage-im…
derrynknife Nov 22, 2026
a5c0a36
Prepare 0.20
derrynknife Nov 22, 2026
0067252
Compare an upgraded diagram's long run with its private call once upg…
derrynknife Nov 22, 2026
80437d2
Merge pull request #515 from derrynknife/build/internals-after-upgrades
derrynknife Nov 22, 2026
42299dd
Merge origin/dev into release/0.20-prep
derrynknife Nov 22, 2026
e8fee7a
Merge pull request #514 from derrynknife/release/0.20-prep
derrynknife Nov 22, 2026
2696742
Format _plan_actual.py with black
derrynknife Nov 22, 2026
948966b
Fix what the 0.20 release PR's full suite found
derrynknife Nov 22, 2026
f819070
Merge pull request #517 from derrynknife/build/black-plan-actual
derrynknife Nov 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
965 changes: 965 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

142 changes: 122 additions & 20 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ first. This file adds the internals and conventions it does not cover.
release; the latest published release is on PyPI
(`https://pypi.org/pypi/repyability/json`) and the CHANGELOG's newest
dated section. New work goes under the CHANGELOG's `[Unreleased]`. The
minimum surpyval is in `pyproject.toml` (0.28 as of 0.19).
minimum surpyval is in `pyproject.toml` (0.29 as of 0.20).

## Architecture & scope

Expand Down Expand Up @@ -43,6 +43,33 @@ minimum surpyval is in `pyproject.toml` (0.28 as of 0.19).
level, and the probabilities a forecast is made of (expected failures
and costs over a window from a state, and their distribution).

- **Maintenance and money are layered.** Each question has one home,
and the layers above call the ones below rather than repeat them:
- `repyability.value`: money. Discounting (one convention, continuous
at a rate per unit of the clock the money falls on; a yearly rate
converted in one place), escalation and real rates,
`ValueSchedule`, the cost categories and the cash-flow table.
- `repyability.maintenance`: a unit's plan and the single part's
maths. `UnitPlan` (its life, repairs, tasks, `Prices`, and its own
`salvage`, `escalation` and `retire_at`; a spec dict is its
shorthand), the policies, and `NonRepairable`'s methods. The
age-replacement EAC has one definition (`_options.cycle_eac`),
which a diagram's component takes too. A plan is valued alone
through its one-node diagram (`UnitPlan.diagram()`): there is no
second single-unit route.
- `repyability.schedule`: the calendar. Rules, duty plans and
`CalendarContext`, which gives an analysis its calendar and each
unit its duty plan. The duty plan belongs to the analysis, not to
the plan or the diagram.
- `RepairableRBD`: only what belongs to the system. Its structure,
system downtime and value, crews, spares, the site's shutdowns and
common-cause groups. A node takes a `UnitPlan` (or its spec), and a
life can be any model with a life's functions, a `NonRepairableRBD`
included.

What is still duplicated is listed in the maintenance README's
"Layers" section, so that it goes rather than spreads.

- **Model behaviour belongs in surpyval too.** When a surpyval model
misbehaves (its draws, means, densities or save format), raise an issue in
derrynknife/surpyval rather than only working around it here. Keep any
Expand Down Expand Up @@ -126,6 +153,17 @@ minimum surpyval is in `pyproject.toml` (0.28 as of 0.19).
a call binds costs reference counting that numba cannot prune in a
function this size, and passing the run's tuples to a function per
simulation cost several times the loop (measured in #206).
- **A life on the diagram's clock is the Python loop's alone**
(`_covariate_schedule.ClockLife`: a covariate schedule's
`ScheduledLife`, and a duty plan that changes over time,
`_duty.PlannedLife`): what is left of a unit's life depends on when it
is put into service (`life_left(t0, age, u)`, the loop's
`_ScheduledComponent`), so the exact methods refuse it and
`_compiled.unsupported` hands it to Python. A task counted in
operating time on such a plan carries it as its `_Preventive.clock`
(due in operating time, mapped back through the plan's inverse). The
engine always runs on calendar time; an analysis's
`schedule.CalendarContext` gives each unit its plan.
- **Simulations take turns across threads (#216).** The event loop keeps
a run's state on the diagram (`_run_state`, an `_events._Run`) and draws that cannot be
streamed come from numpy's global RNG, so a run holds
Expand Down Expand Up @@ -221,9 +259,26 @@ minimum surpyval is in `pyproject.toml` (0.28 as of 0.19).
checks it changes nothing.
- **The repair crews' Markov chain (`repyability/rbd/_crew_chain.py`)
copies the simulation's queue (`_events._Crews`)**: which waiting job a free crew
takes, and how instant jobs pass through. A change to one goes into the
other; `test_crew_chain.py` checks the chain's exact values against the
simulation. Likewise a standby group's chain (`_standby_chain.py`) copies
takes, and how instant jobs pass through, and when a call-out crew
(`call_out`) comes and goes: it is engaged exactly while a job more than
the crews is under repair, so the chain's state needs nothing more. A
change to one goes into the other; `test_crew_chain.py` and
`test_call_out_crew.py` check the chain's exact values against the
simulation. It takes common-cause groups in too (#251,
`_crews._crew_causes`): a shared cause's strike is its members' failures
one after another in the cause's order, each as a failure of its own
(`_crew_chain._enumerate`'s `failed`), which is the order
`_event_loop._strike` queues them in only for two members (the event
queue releases ties at one time by its heap's shape, so the chain
refuses causes of more, `MAX_STRUCK`); `test_crews_ccf.py` checks it
against the simulation. The chain can count a component's alike copies
(`copies`: a state says how many are under repair and waiting, not
which), for the redundancy allocation with crews
(`_crew_allocation.py`, each design worked out whole from its chain,
the search bounded by the unavailability with a crew for every job and
the copies' prices); `test_crew_allocation.py` checks the counted chain
against the chain of every copy, and each design against the diagram
with its copies drawn out. Likewise a standby group's chain (`_standby_chain.py`) copies
`_events._StandbyGroup`'s rules (switching, spares, repairs), checked by
`test_repairable_standby.py`.
- **A phased mission's Markov chain (`repyability/rbd/_mission_chain.py`)
Expand Down Expand Up @@ -258,6 +313,18 @@ minimum surpyval is in `pyproject.toml` (0.28 as of 0.19).
(`_Counted`) rather than tell them apart, which holds for a
`BetaFactor`'s one shared cause: `test_ccf_allocations.py` checks them
against the chain of every copy.
- **A `Shocks` group's causes are the simulation's shared causes at
rates of their own** (`_ccf_groups._shared_causes`, from
`Shocks.causes`): every set of members a shock can fail, a single
member's too, each a `_Cause` on the cause streams, while a member's
own life is its own model's (`_own_rate` is None). A cause names its
members in the group's order, which is the order `_event_loop._strike`
fails them in: that is the rule for members struck at one instant. No
chain copies them: `_ccf_rates` refuses the group for every exact
method. A `NonRepairableRBD` writes the same causes into its structure
(`shocks.written_shocks`) and is from then on the diagram written out;
it saves the diagram as given (`_given_args`). `test_shock_nodes.py`
and `test_repairable_shocks.py` check both.
- **A common-cause group's chain with tests and repairs that take time
(`_ccf_chain._Timed`, #220) copies the simulation's inspections** too
(`_event_loop._inspected_follow_up`, `_event_loop._inspected_next`, `_event_loop._strike`): a working member
Expand Down Expand Up @@ -449,7 +516,14 @@ minimum surpyval is in `pyproject.toml` (0.28 as of 0.19).
public function of the classes that simulate (an `RBD` subclass gets it
from `RBD.__init_subclass__`); a new class whose methods take
`mc_samples` gets `@refuse_removed_names`. A seed goes through
`checks.seed` where it is taken.
`checks.seed` where it is taken. `n_draws` is kept, deliberately, for
the number of draws of uncertain models' parameters (the
`*_uncertainty` methods, `uncertainty_importance`,
`optimal_replacement_intervals`), each draw worked out without
simulating it: a method that takes `n_draws` but not `mc_samples`
refuses `mc_samples=` (and the removed names), naming `n_draws`, through
the same wrapper (a class with such methods gets `@refuse_removed_names`
too).
- **Inputs are checked where they are given (#233)**: numbers through
`checks.is_number`/`number_or_nan` (not `bool`, not text), times through
`checks.real_array`, a choice of option through `checks.one_of`, and
Expand Down Expand Up @@ -499,11 +573,22 @@ minimum surpyval is in `pyproject.toml` (0.28 as of 0.19).
`surpyval.test_planning`'s, and 0.18 removed them with
`DemonstrationPlan` (`test_removed_in_0_18.py`). 0.18 and 0.19
deprecate nothing, so 0.19 removes nothing (nor does 0.19.1, which
only adds the life at a usage rate as a block); `NEXT_REMOVAL` is 0.20,
which `test_what_0_19_deprecates_goes_in_0_20` reminds. A new
only adds the life at a usage rate as a block), and 0.20 removes
nothing. 0.20 deprecates, for 0.21 (`NEXT_REMOVAL`, which
`test_what_0_20_deprecates_goes_in_0_21` in `test_api_consistency.py`
reminds; a deprecation in 0.21's development goes in
`REMOVED_IN_0_22`), `Calendar`,
`Shutdown`, `Shutdowns`, prices on opportunities and
`optimal_calendar_policy`/`calendar_policy_cost` (UC-45; the prices
come with the part), which `test_what_0_20_deprecates_goes_in_0_21`
(`test_opportunities.py`) reminds, and `method="auto"` sampling a
calendar too long to sweep (UC-44, `refuses_from`), which
`test_auto_sampling_refuses_in_0_21` (`test_exact_or_horizon.py`)
reminds. A new
deprecation warns through `deprecation.renamed`, `renamed_attribute`,
`called`, `ignored` or `moved`, with a test that fails once the version
reaches its removal.
`called`, `ignored`, `moved`, `replaced`, `price_on_part` or
`refuses_from`, with a test
that fails once the version reaches its removal.
- **No result depends on the unit of time (or of a covariate).** A step,
grid or probe is sized from the models (a typical life,
`failure_time_scale`), never in absolute time, and a proportional
Expand Down Expand Up @@ -563,10 +648,14 @@ RePyability's own in 0.17 with the same values.
surpyval's deprecation policy calls public (the top level, its listed
subpackages' `__all__`, `surpyval.univariate.regression.kinds`) and reads
no underscored attribute; `test_public_surpyval_api.py` fails on anything
else. Two names have no public home yet and are listed there
(`NO_PUBLIC_HOME`): `DynamicPrediction` (`rbd/joint_node.py`) and
`conditional_gaps` (`rbd/_event_loop._aged_life`). Take each from its
public home once surpyval gives it one; that test fails when it does.
else. Take a model class from its subpackage, not the top level
(`surpyval.univariate.joint`'s `JointModel`,
`surpyval.univariate.regression`'s `SemiParametricRegressionModel`): from
0.29 surpyval keeps only what users call at its top level, and the rest
warn there. One name has no public home yet and is listed there
(`NO_PUBLIC_HOME`): `conditional_gaps` (`rbd/_event_loop._aged_life`).
Take it from its public home once surpyval gives it one; that test fails
when it does.

What remains (each checked against surpyval 0.28 on 15 Nov 2026):

Expand Down Expand Up @@ -594,13 +683,14 @@ What remains (each checked against surpyval 0.28 on 15 Nov 2026):
condition on survival, which for a Wiener path keeps the units that
crossed and came back, so it is not this.)

- **Rescaling a model's time for a duty cycle.** surpyval has no
rescaling (#845 gave models only a unit label). A spec's `"duty"` puts a
life in operating time on the calendar, `R(d t)`, by `_duty._SCALED`, one rule per surpyval distribution (a new
one needs its rule there, which `test_units` checks against `R(d t)`).
Take surpyval's rescaling once the minimum surpyval has it. (0.28's
`EquivalenceModel.at_usage` turns a two-clock life into one clock at a
usage rate; it does not rescale a model's time.)
- **Rescaling a model's time for a duty cycle** (surpyval 0.28 only).
A spec's `"duty"` puts a life in operating time on the calendar, `R(d
t)`, by the model's own `rescale_time(d)` (surpyval's release after
0.28). With 0.28, which has none, `_duty._SCALED` moves each surpyval
distribution's parameters (a rule per distribution, which `test_units`
checks against `R(d t)` with `rescale_time` hidden). Drop `_SCALED`,
and `on_calendar`'s fallback, once the minimum surpyval has
`rescale_time`.
- **Parameter ranges for drawing fits other than distributions** (no
surpyval issue yet). surpyval gives no range per parameter for a
regression, a degradation or repairable-unit process or a mixture, so
Expand All @@ -609,6 +699,18 @@ What remains (each checked against surpyval 0.28 on 15 Nov 2026):
scale. Take surpyval's ranges once the minimum surpyval says them.
(0.27 keeps them private, such as a regression's `_parameter_bounds`.)

- **A share of a model's hazard** (no surpyval issue known yet: a hazard
ratio as a model option, with `isf`). A common-cause group splitting
the failure rate gives each cause a share `c` of its members' hazard,
survival `R(t)^c`, which no surpyval 0.28 model is. `ccf._hazard` and
`ccf._rate_causes` work it out from the members' own model as
`exp(-c H)` and `-expm1(-c H)` (`H` from whichever of `ff` and `sf`
keeps its digits), and `NonRepairableRBD._group_sampler` draws it
through the members' quantile function at `-expm1(-e)`, `e` the first
of the causes' exponential times. Build each cause's life with
surpyval's hazard ratio (`from_params(..., hr=c)`) once the minimum
surpyval has it.

- **A joint frailty model's own integration in `RepairOrReplace`**
(`maintenance/_repair_or_replace.py`). surpyval 0.27's
`JointFrailtyModel.mcf` fell towards 0 far past the write-off ages;
Expand Down
Loading
Loading