From e7595c32015e73671a96a3b2cec6ab9b8ca1c491 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 7 Apr 2022 10:58:15 -0500 Subject: [PATCH] Don't throw away precision on K-M slope calculation --- openmc/data/kalbach_mann.py | 4 +--- tests/unit_tests/test_data_kalbach_mann.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/openmc/data/kalbach_mann.py b/openmc/data/kalbach_mann.py index 5c0423f30c..932deea872 100644 --- a/openmc/data/kalbach_mann.py +++ b/openmc/data/kalbach_mann.py @@ -299,9 +299,7 @@ def kalbach_slope(energy_projectile, energy_emitted, iza_projectile, r_3 = min(e_a, 41.) x_1 = r_1 * e_b / e_a x_3 = r_3 * e_b / e_a - slope = 0.04 * x_1 + 1.8e-6 * x_1**3 + 6.7e-7 * M * m * x_3**4 - - return float("%7e" % slope) + return 0.04 * x_1 + 1.8e-6 * x_1**3 + 6.7e-7 * M * m * x_3**4 class KalbachMann(AngleEnergy): diff --git a/tests/unit_tests/test_data_kalbach_mann.py b/tests/unit_tests/test_data_kalbach_mann.py index 643fffcfca..27890dacd5 100644 --- a/tests/unit_tests/test_data_kalbach_mann.py +++ b/tests/unit_tests/test_data_kalbach_mann.py @@ -173,7 +173,7 @@ def test_comparison_slope_hdf5(hdf5_filename, endf_type, endf_filename): np.testing.assert_array_almost_equal( endf_distribution.slope[i].y, hdf5_slope.y, - decimal=6 + decimal=5 ) @@ -227,5 +227,5 @@ def test_comparison_slope_njoy(endf_type, endf_filename): np.testing.assert_array_almost_equal( endf_distribution.slope[i].y, njoy_slope.y, - decimal=6 + decimal=5 )