From 44a13a8d1f2a6ddb7769a5194546ad0705f9aa53 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 16 Oct 2026 20:10:51 +0000 Subject: [PATCH] Narrow a minimal-repair curve's grid values for mypy 2.3.0 MinimalRepairCurve keeps its grid's values (up, failures) as optional beside its times, set together. mypy 2.3.0, which CI pins, does not narrow them with the times at np.interp, and failed the release pull request (#353); mypy 2.3.1 does. Each read asserts the invariant. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Ng6hwUY8zznhm1jRfZJqZ --- repyability/rbd/_point_availability.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/repyability/rbd/_point_availability.py b/repyability/rbd/_point_availability.py index 736a9b4..37223be 100644 --- a/repyability/rbd/_point_availability.py +++ b/repyability/rbd/_point_availability.py @@ -2002,6 +2002,7 @@ def __init__( def at(self, x: np.ndarray) -> np.ndarray: if self.times is None: return np.ones(np.shape(x)) + assert self.up is not None # set with times return np.interp(x, self.times, self.up) def knots(self, start: float, stop: float) -> np.ndarray: @@ -2042,6 +2043,7 @@ def events(self, x: np.ndarray) -> Dict[str, np.ndarray]: x = np.asarray(x, dtype=float) if self.times is None: return _events(cumulative_hazard(self.life, x)) + assert self.failures is not None # set with times return _events(np.interp(x, self.times, self.failures)) def atoms(self, stop: float) -> Atoms: