Skip to content

Commit 835ade2

Browse files
igerberclaude
andcommitted
Fix Rust backend test for loocv_grid_search 7-value return
Update test to unpack 7 values from loocv_grid_search (added first_failed_obs in round 8) and add assertion for the new return value. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6273674 commit 835ade2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/test_rust_backend.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ def test_loocv_grid_search_returns_valid_params(self):
970970
lambda_unit = np.array([0.0, 1.0], dtype=np.float64)
971971
lambda_nn = np.array([0.0, 0.1], dtype=np.float64)
972972

973-
best_lt, best_lu, best_ln, score, n_valid, n_attempted = loocv_grid_search(
973+
best_lt, best_lu, best_ln, score, n_valid, n_attempted, first_failed = loocv_grid_search(
974974
Y, D, control_mask, time_dist,
975975
lambda_time, lambda_unit, lambda_nn,
976976
50, 100, 1e-6, 42
@@ -985,6 +985,8 @@ def test_loocv_grid_search_returns_valid_params(self):
985985
assert n_valid >= 0
986986
assert n_attempted >= 0
987987
assert n_valid <= n_attempted
988+
# Check first_failed is None or a valid (unit, time) tuple
989+
assert first_failed is None or (isinstance(first_failed, tuple) and len(first_failed) == 2)
988990

989991
def test_bootstrap_variance_shape(self):
990992
"""Test bootstrap returns correct shapes."""

0 commit comments

Comments
 (0)