From 06002383152fe7227ecdc6d385f8a8c298f95a21 Mon Sep 17 00:00:00 2001 From: ariel Date: Fri, 28 Jun 2024 00:36:27 +0200 Subject: [PATCH] Fix a new overflow in tests --- tests/spaces/test_spaces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spaces/test_spaces.py b/tests/spaces/test_spaces.py index c77c62aa3..6df5963dc 100644 --- a/tests/spaces/test_spaces.py +++ b/tests/spaces/test_spaces.py @@ -239,7 +239,7 @@ def chi2_test(sample, low, high, bounded_below, bounded_above): if bounded_below and bounded_above: # X ~ U(low, high) - degrees_of_freedom = high - low + 1 + degrees_of_freedom = int(high) - int(low) + 1 observed_frequency = np.bincount(sample - low, minlength=degrees_of_freedom) assert observed_frequency.shape == (degrees_of_freedom,) expected_frequency = np.ones(degrees_of_freedom) * n_trials / degrees_of_freedom