diff --git a/repyability/rbd/_chain_transient.py b/repyability/rbd/_chain_transient.py index be8fda7..5eb3d72 100644 --- a/repyability/rbd/_chain_transient.py +++ b/repyability/rbd/_chain_transient.py @@ -336,6 +336,13 @@ def __init__( #: For the pieces of the integrals: the chain's knots and settling. self.curve = ChainCurve(chain) + def jump_times(self, stop: float) -> np.ndarray: + """The times in ``(0, stop)`` at which the chain's states jump + down at exact times: none, as its components fail and are + repaired at rates (a common-cause group's chain jumps at its + members' tests, see ``_ccf_chain.GroupsSystem.jump_times``).""" + return np.empty(0) + def evaluate(self, values: dict, x: np.ndarray): """At the times ``x``, with each nested RBD up with the probability ``values[node]`` (an array over ``x``): each nested RBD's Birnbaum diff --git a/repyability/tests/test_chains_over_time.py b/repyability/tests/test_chains_over_time.py index 4bd8813..4ee68c3 100644 --- a/repyability/tests/test_chains_over_time.py +++ b/repyability/tests/test_chains_over_time.py @@ -558,11 +558,13 @@ def plant(crews): independent, chained = plant(2), plant(2) chained._crews_couple = lambda: True # type: ignore[method-assign] windows = np.array([5.0, 60.0, 400.0]) + # Each path integrates by its own quadrature: over the shortest window + # both are within about 2e-6 of the closed form (the chain's closer). for name in ("system_failures", "system_downtime"): np.testing.assert_allclose( chained.expected_events(windows)[name], independent.expected_events(windows)[name], - rtol=1e-6, + rtol=5e-6, atol=1e-10, ) np.testing.assert_allclose( diff --git a/repyability/tests/test_condition_long_run.py b/repyability/tests/test_condition_long_run.py index 84f9662..8665331 100644 --- a/repyability/tests/test_condition_long_run.py +++ b/repyability/tests/test_condition_long_run.py @@ -84,10 +84,20 @@ def test_a_threshold_of_0_replaces_at_every_inspection(duration): def test_a_threshold_no_inspection_reaches_runs_to_failure(): - never = RepairableRBD(PAIR, {"a": unit(threshold=1.0), "b": unit()}) + # Priced, as the cost analyses refuse a diagram with nothing priced. + never = RepairableRBD( + PAIR, {"a": unit(threshold=1.0, repair_cost=100.0), "b": unit()} + ) plain = RepairableRBD( PAIR, - {"a": {"reliability": LIFE, "repairability": REPAIR}, "b": unit()}, + { + "a": { + "reliability": LIFE, + "repairability": REPAIR, + "repair_cost": 100.0, + }, + "b": unit(), + }, ) for name in LONG_RUN: assert getattr(never, name)() == pytest.approx(