From 14cf42a067b33092805e0dcc9c7a7cd4c0f7ef21 Mon Sep 17 00:00:00 2001 From: kusch lionel Date: Tue, 9 Sep 2025 17:02:32 +0200 Subject: [PATCH] fix test --- test/_utils/test_scenario.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/_utils/test_scenario.py b/test/_utils/test_scenario.py index a1bbfe566..8a0179aa2 100644 --- a/test/_utils/test_scenario.py +++ b/test/_utils/test_scenario.py @@ -47,7 +47,10 @@ def test_multivariate_simulation_2D( seed=seed, ) - signal_noise_ratio_hat = np.linalg.norm(y - noise) / np.linalg.norm(noise) + if signal_noise_ratio != np.inf: + signal_noise_ratio_hat = np.linalg.norm(y - noise) / np.linalg.norm(noise) + else: + signal_noise_ratio_hat = np.ones_like(y) * np.inf rho_hat = np.corrcoef(X[:, 19], X[:, 20])[0, 1] # check if the data has expected shape