From 5357bdabbb2d69084f35402b34ccda465cb1ca4c Mon Sep 17 00:00:00 2001 From: Jingang Liang Date: Wed, 14 Oct 2020 11:09:33 +0800 Subject: [PATCH] added log=True in multipole generation tests --- openmc/data/multipole.py | 8 +++----- tests/unit_tests/test_data_multipole.py | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/openmc/data/multipole.py b/openmc/data/multipole.py index b56a0f3fa7..5e8e3086c2 100644 --- a/openmc/data/multipole.py +++ b/openmc/data/multipole.py @@ -455,10 +455,7 @@ def vectfit_nuclide(endf_file, njoy_error=5e-4, vf_pieces=None, E_min, E_max = energy[0], energy[-1] n_points = energy.size total_xs = nuc_ce[1].xs['0K'](energy) - try: - elastic_xs = nuc_ce[2].xs['0K'](energy) - except KeyError: - elastic_xs = np.zeros_like(total_xs) + elastic_xs = nuc_ce[2].xs['0K'](energy) try: absorption_xs = nuc_ce[27].xs['0K'](energy) @@ -1067,7 +1064,8 @@ class WindowedMultipole(EqualityMixin): mp_data : dictionary or str Dictionary or Path to the multipole data stored in a pickle file search : bool, optional - Whether to search for optimal window size and curvefit order + Whether to search for optimal window size and curvefit order. + Defaults to True if no windowing parameters are specified. log : bool or int, optional Whether to print running logs (use int for verbosity control) **kwargs diff --git a/tests/unit_tests/test_data_multipole.py b/tests/unit_tests/test_data_multipole.py index 4b641df7c2..4c2ba96d62 100644 --- a/tests/unit_tests/test_data_multipole.py +++ b/tests/unit_tests/test_data_multipole.py @@ -53,7 +53,7 @@ def test_from_endf(): endf_data = os.environ['OPENMC_ENDF_DATA'] endf_file = os.path.join(endf_data, 'neutrons', 'n-001_H_001.endf') return openmc.data.WindowedMultipole.from_endf( - endf_file, wmp_options={"n_win": 400, "n_cf": 3}) + endf_file, log=True, wmp_options={"n_win": 400, "n_cf": 3}) def test_from_endf_search(): @@ -61,4 +61,4 @@ def test_from_endf_search(): endf_data = os.environ['OPENMC_ENDF_DATA'] endf_file = os.path.join(endf_data, 'neutrons', 'n-095_Am_244.endf') return openmc.data.WindowedMultipole.from_endf( - endf_file, wmp_options={"search": True, 'rtol':1e-2}) + endf_file, log=True, wmp_options={"search": True, 'rtol':1e-2})