From 6fdc7657c7f1a618be6649355381a7b4a30fa1b6 Mon Sep 17 00:00:00 2001 From: AI-Pranto Date: Mon, 1 Mar 2021 21:45:42 +0600 Subject: [PATCH] reflect change only on source side --- openmc/settings.py | 10 +++++----- tests/regression_tests/surface_source/test.py | 2 +- tests/unit_tests/test_settings.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openmc/settings.py b/openmc/settings.py index 73722c9fef..57155b0dfe 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -152,7 +152,7 @@ class Settings: :surface_ids: List of surface ids at which crossing particles are to be banked (int) - :max_surface_particles: Maximum number of particles to be banked on + :max_particles: Maximum number of particles to be banked on surfaces per process (int) survival_biasing : bool Indicate whether survival biasing is to be used @@ -604,14 +604,14 @@ class Settings: cv.check_type('surface source writing options', surf_source_write, Mapping) for key, value in surf_source_write.items(): cv.check_value('surface source writing key', key, - ('surface_ids', 'max_surface_particles')) + ('surface_ids', 'max_particles')) if key == 'surface_ids': cv.check_type('surface ids for source banking', value, Iterable, Integral) for surf_id in value: cv.check_greater_than('surface id for source banking', surf_id, 0) - elif key == 'max_surface_particles': + elif key == 'max_particles': cv.check_type('maximum particle banks on surfaces per process', value, Integral) cv.check_greater_than('maximum particle banks on surfaces per process', @@ -954,9 +954,9 @@ class Settings: subelement = ET.SubElement(element, "surface_ids") subelement.text = ' '.join( str(x) for x in self._surf_source_write['surface_ids']) - if 'max_surface_particles' in self._surf_source_write: + if 'max_particles' in self._surf_source_write: subelement = ET.SubElement(element, "max_surface_particles") - subelement.text = str(self._surf_source_write['max_surface_particles']) + subelement.text = str(self._surf_source_write['max_particles']) def _create_confidence_intervals(self, root): if self._confidence_intervals is not None: diff --git a/tests/regression_tests/surface_source/test.py b/tests/regression_tests/surface_source/test.py index 8646930397..492ef192e9 100644 --- a/tests/regression_tests/surface_source/test.py +++ b/tests/regression_tests/surface_source/test.py @@ -47,7 +47,7 @@ def model(request): openmc_model.settings.source = pt_src openmc_model.settings.surf_source_write = {'surface_ids': [1], - 'max_surface_particles': 1000} + 'max_particles': 1000} elif surf_source_op == 'read': openmc_model.settings.surf_source_read = {'path': 'surface_source_true.h5'} diff --git a/tests/unit_tests/test_settings.py b/tests/unit_tests/test_settings.py index 34f3d3086c..7a3357d439 100644 --- a/tests/unit_tests/test_settings.py +++ b/tests/unit_tests/test_settings.py @@ -21,7 +21,7 @@ def test_export_to_xml(run_in_tmpdir): 'write': True, 'overwrite': True} s.statepoint = {'batches': [50, 150, 500, 1000]} s.surf_source_read = {'path': 'surface_source_1.h5'} - s.surf_source_write = {'surface_ids': [2], 'max_surface_particles': 200} + s.surf_source_write = {'surface_ids': [2], 'max_particles': 200} s.confidence_intervals = True s.ptables = True s.seed = 17 @@ -79,7 +79,7 @@ def test_export_to_xml(run_in_tmpdir): 'write': True, 'overwrite': True} assert s.statepoint == {'batches': [50, 150, 500, 1000]} assert s.surf_source_read == {'path': 'surface_source_1.h5'} - assert s.surf_source_write == {'surface_ids': [2], 'max_surface_particles': 200} + assert s.surf_source_write == {'surface_ids': [2], 'max_particles': 200} assert s.confidence_intervals assert s.ptables assert s.seed == 17