Skip to content

Commit

Permalink
Fix error message
Browse files Browse the repository at this point in the history
  • Loading branch information
sebp committed Feb 16, 2025
1 parent 7c50afd commit bb94293
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sksurv/nonparametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ def cumulative_incidence_competing_risks(
elif var_type == "Aalen":
var = _var_aalen(n_events_cr, kpe_prime, n_at_risk, cum_inc)
else:
raise ValueError(f"{var_type=} must be one of 'Dinse', 'Dinse_approx' or 'Aalen'.")
raise ValueError(f"{var_type=} must be one of 'Dinse', 'Dinse_Approx' or 'Aalen'.")

_x, _y, conf_int_km = kaplan_meier_estimator(event > 0, time_exit, conf_type="log-log")
ci = np.empty(shape=(2, n_risks + 1, n_t), dtype=conf_int_km.dtype)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_nonparametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -7657,6 +7657,6 @@ def test_invalid_conf_type_competing_risks(event, time, true_x, true_y, conf_typ
@pytest.mark.parametrize("event, time, true_x, true_y", SimpleDataBMTCases().get_cases())
@pytest.mark.parametrize("var_type", ["None", "dinse", 1, "", "not"])
def test_invalid_var_type_competing_risks(event, time, true_x, true_y, var_type):
msg = f"{var_type=} must be one of 'Dinse', 'Dinse_approx' or 'Aalen'."
msg = f"{var_type=} must be one of 'Dinse', 'Dinse_Approx' or 'Aalen'."
with pytest.raises(ValueError, match=msg):
cumulative_incidence_competing_risks(event, time, conf_level=0.95, conf_type="log-log", var_type=var_type)

0 comments on commit bb94293

Please sign in to comment.