diff --git a/seismostats/analysis/tests/test_estimate_mc.py b/seismostats/analysis/tests/test_estimate_mc.py index abd018c..2a47283 100644 --- a/seismostats/analysis/tests/test_estimate_mc.py +++ b/seismostats/analysis/tests/test_estimate_mc.py @@ -132,16 +132,21 @@ def test_empirical_cdf(setup_magnitudes, delta_m=0.1): # 1. with equal weights magnitudes = np.array([0.5, 0.6, 0.7, 0.8, 0.9]) weights = np.array([1, 1, 1, 1, 1]) - x, y = empirical_cdf(magnitudes, mc=0, delta_m=0.1, weights=weights) - assert_almost_equal(x, np.arange(0, 1, 0.1)) - assert_almost_equal(y, [0, 0, 0, 0, 0, 0.2, 0.4, 0.6, 0.8, 1]) + x_weight, y_weight = empirical_cdf( + magnitudes, mc=0, delta_m=0.1, weights=weights) + x, y = empirical_cdf(magnitudes, mc=0, delta_m=0.1) + assert_almost_equal(x_weight, np.arange(0, 1, 0.1)) + assert_almost_equal(y_weight, [0, 0, 0, 0, 0, 0.2, 0.4, 0.6, 0.8, 1]) + assert_almost_equal(x_weight, x) + assert_almost_equal(y_weight, y) # 2. with different weights magnitudes = np.array([0.5, 0.6, 0.7, 0.8, 0.9]) weights = np.array([0.5, 0.5, 0.5, 0.5, 3]) - x, y = empirical_cdf(magnitudes, mc=0, delta_m=0.1, weights=weights) - assert_almost_equal(x, np.arange(0, 1, 0.1)) - assert_almost_equal(y, [0, 0, 0, 0, 0, 0.1, 0.2, 0.3, 0.4, 1]) + x_weight, y_weight = empirical_cdf( + magnitudes, mc=0, delta_m=0.1, weights=weights) + assert_almost_equal(x_weight, np.arange(0, 1, 0.1)) + assert_almost_equal(y_weight, [0, 0, 0, 0, 0, 0.1, 0.2, 0.3, 0.4, 1]) @pytest.fixture