From c940cfc40ab0333109bd3ac4af60259640bd9fae Mon Sep 17 00:00:00 2001 From: Hiroki Yoneda Date: Fri, 25 Oct 2024 12:44:47 -0700 Subject: [PATCH] Minor change on unittest of line_background_estimation --- tests/background_estimation/test_line_background_estimation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/background_estimation/test_line_background_estimation.py b/tests/background_estimation/test_line_background_estimation.py index df0bb284..0d9a13f1 100644 --- a/tests/background_estimation/test_line_background_estimation.py +++ b/tests/background_estimation/test_line_background_estimation.py @@ -44,7 +44,7 @@ def bkg_model(x, a, b): bkg_model_histogram = instance.generate_bkg_model_histogram(source_range, [background_region]) ### check sum - assert np.sum(bkg_model_histogram) == 41.61181341324655 + assert np.isclose(np.sum(bkg_model_histogram), 41.61181341324655, atol = 1e-5) == True ## Case 2: a single extracting region broader than the actual bin width background_region = (1119.0, 1651.0) * u.keV