From e3cc3f16133f4a7a4746d7da1cb6e4502d78629f Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 8 Dec 2021 00:59:23 +0000 Subject: [PATCH 01/12] added dagmc boundign box --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 8eefd51..dd0b4ba 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,7 @@ "plotly", "defusedxml", "dagmc_h5m_file_inspector", + "dagmc_bounding_box", ], # openmc, dagmc, moab are also needed and embree and double down are also # optionally needed but not avaible on PyPi From 111053dd87d6bee11c26a4b53c09f9f2c256ed13 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 8 Dec 2021 00:59:40 +0000 Subject: [PATCH 02/12] added corners method --- openmc_dagmc_wrapper/Geometry.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/openmc_dagmc_wrapper/Geometry.py b/openmc_dagmc_wrapper/Geometry.py index 2d5a547..aa86293 100644 --- a/openmc_dagmc_wrapper/Geometry.py +++ b/openmc_dagmc_wrapper/Geometry.py @@ -3,7 +3,7 @@ import dagmc_h5m_file_inspector as di import openmc from numpy import cos, sin - +from dagmc_bounding_box import DagmcBoundingBox class Geometry(openmc.Geometry): """A openmc.Geometry object with a DAGMC Universe. If the model @@ -25,16 +25,31 @@ class Geometry(openmc.Geometry): def __init__( self, - h5m_filename: str = None, + h5m_filename: str, reflective_angles: Tuple[float, float] = None, graveyard_box=None, ): self.h5m_filename = h5m_filename self.reflective_angles = reflective_angles self.graveyard_box = graveyard_box + self.dagmc_bounding_box = DagmcBoundingBox(h5m_filename) super().__init__(root=self.make_root()) + def corners( + self, expand: Tuple[float, float, float] = None + ) -> Tuple[Tuple[float, float, float], Tuple[float, float, float]]: + """Gets the lower left corner and upper right corner of the DAGMC + geometry + Args: + expand: + Returns: + A tuple of two coordinates + """ + + return self.dagmc_bounding_box.corners(expand) + + def make_root(self): # this is the underlying geometry container that is filled with the From 49785d42392943b72f0716a44eaff957ff337b7f Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 8 Dec 2021 01:00:04 +0000 Subject: [PATCH 03/12] added minimal tests for geometry --- tests/test_geometry.py | 76 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 tests/test_geometry.py diff --git a/tests/test_geometry.py b/tests/test_geometry.py new file mode 100644 index 0000000..e9038c1 --- /dev/null +++ b/tests/test_geometry.py @@ -0,0 +1,76 @@ +import tarfile +import unittest +import urllib.request +from pathlib import Path + +import openmc +import openmc_dagmc_wrapper as odw + + +class TestSettings(unittest.TestCase): + """Tests the geometry.py file functionality""" + + def setUp(self): + + if not Path("tests/v0.0.2.tar.gz").is_file(): + url = "https://github.com/fusion-energy/neutronics_workflow/archive/refs/tags/v0.0.2.tar.gz" + urllib.request.urlretrieve(url, "tests/v0.0.2.tar.gz") + + tar = tarfile.open("tests/v0.0.2.tar.gz", "r:gz") + tar.extractall("tests") + tar.close() + + self.h5m_filename_smaller = "tests/neutronics_workflow-0.0.2/example_01_single_volume_cell_tally/stage_2_output/dagmc.h5m" + self.h5m_filename_bigger = "tests/neutronics_workflow-0.0.2/example_02_multi_volume_cell_tally/stage_2_output/dagmc.h5m" + + self.material_description_bigger = { + "pf_coil_case_mat": "Be", + "center_column_shield_mat": "Be", + "blanket_rear_wall_mat": "Be", + "divertor_mat": "Be", + "tf_coil_mat": "Be", + "pf_coil_mat": "Be", + "inboard_tf_coils_mat": "Be", + "blanket_mat": "Be", + "firstwall_mat": "Be", + } + + def test_attributes(self): + my_geometry = odw.Geometry(h5m_filename=self.h5m_filename_smaller) + assert my_geometry.reflective_angles == None + assert my_geometry.graveyard_box == None + # TODO dagmc_bounding_box + + def test_corners_types(self): + """checks the corner method returns the correct types""" + my_geometry = odw.Geometry(h5m_filename=self.h5m_filename_smaller) + assert isinstance(my_geometry.corners(), tuple) + assert isinstance(my_geometry.corners()[0], tuple) + assert isinstance(my_geometry.corners()[1], tuple) + assert isinstance(my_geometry.corners()[0][0], float) + assert isinstance(my_geometry.corners()[0][1], float) + assert isinstance(my_geometry.corners()[0][2], float) + assert isinstance(my_geometry.corners()[1][0], float) + assert isinstance(my_geometry.corners()[1][1], float) + assert isinstance(my_geometry.corners()[1][2], float) + + def test_corners_dimensions(self): + """checks length of tuples returned""" + my_geometry = odw.Geometry(h5m_filename=self.h5m_filename_smaller) + assert len(my_geometry.corners()) == 2 + assert len(my_geometry.corners()[0]) == 3 + assert len(my_geometry.corners()[1]) == 3 + + def test_corners_expand_increases_size(self): + """checks the expand increases the value returned""" + my_geometry = odw.Geometry(h5m_filename=self.h5m_filename_smaller) + small_corners = my_geometry.corners() + big_corners = my_geometry.corners(expand=(1,2,3)) + + assert small_corners[0][0] -1 == big_corners[0][0] + assert small_corners[0][1] -2 == big_corners[0][1] + assert small_corners[0][2] -3 == big_corners[0][2] + + assert small_corners[1][0] +1 == big_corners[1][0] + assert small_corners[1][1] +2 == big_corners[1][1] + assert small_corners[1][2] +3 == big_corners[1][2] From 1b44638ead751f9c2d17a0dd8a4751059a5faa7a Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 8 Dec 2021 01:04:24 +0000 Subject: [PATCH 04/12] updated examples to use the corner attribute --- examples/regular_2d_mesh_tally_example.py | 5 +++-- examples/regular_3d_mesh_tally_example.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/regular_2d_mesh_tally_example.py b/examples/regular_2d_mesh_tally_example.py index ae7ff91..f9930c1 100644 --- a/examples/regular_2d_mesh_tally_example.py +++ b/examples/regular_2d_mesh_tally_example.py @@ -45,8 +45,9 @@ ) # makes use of the dagmc-bound-box package to get the corners of the bounding -# box. This will be used to set the bounding box for the tally -my_bounding_box = DagmcBoundingBox(h5m_filename).corners() +# box. This will be used to set the bounding box for the tally. This can be +# expanded with the expand keyword if needed +my_bounding_box = geometry.corners() # A MeshTally2D tally allows a set of standard tally types (made from filters diff --git a/examples/regular_3d_mesh_tally_example.py b/examples/regular_3d_mesh_tally_example.py index 58c60c0..936506c 100644 --- a/examples/regular_3d_mesh_tally_example.py +++ b/examples/regular_3d_mesh_tally_example.py @@ -45,8 +45,9 @@ ) # makes use of the dagmc-bound-box package to get the corners of the bounding -# box. This will be used to set the bounding box for the tally -my_bounding_box = DagmcBoundingBox(h5m_filename).corners() +# box. This will be used to set the bounding box for the tally. This can be +# expanded with the expand keyword if needed +my_bounding_box = geometry.corners() # A MeshTally3D tally allows a set of standard tally types (made from filters # and scores) to be applied to the DAGMC geometry. By default the mesh will be From 903a40afdddbc9cf1bed7e169eeb816822b37846 Mon Sep 17 00:00:00 2001 From: autopep8 Date: Wed, 8 Dec 2021 01:05:43 +0000 Subject: [PATCH 05/12] Automated autopep8 fixes --- openmc_dagmc_wrapper/Geometry.py | 2 +- tests/test_geometry.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/openmc_dagmc_wrapper/Geometry.py b/openmc_dagmc_wrapper/Geometry.py index aa86293..1b95bcb 100644 --- a/openmc_dagmc_wrapper/Geometry.py +++ b/openmc_dagmc_wrapper/Geometry.py @@ -5,6 +5,7 @@ from numpy import cos, sin from dagmc_bounding_box import DagmcBoundingBox + class Geometry(openmc.Geometry): """A openmc.Geometry object with a DAGMC Universe. If the model requires a graveyard bounding box this will be automatically added. When @@ -49,7 +50,6 @@ def corners( return self.dagmc_bounding_box.corners(expand) - def make_root(self): # this is the underlying geometry container that is filled with the diff --git a/tests/test_geometry.py b/tests/test_geometry.py index e9038c1..b8c079b 100644 --- a/tests/test_geometry.py +++ b/tests/test_geometry.py @@ -37,10 +37,10 @@ def setUp(self): def test_attributes(self): my_geometry = odw.Geometry(h5m_filename=self.h5m_filename_smaller) - assert my_geometry.reflective_angles == None - assert my_geometry.graveyard_box == None + assert my_geometry.reflective_angles is None + assert my_geometry.graveyard_box is None # TODO dagmc_bounding_box - + def test_corners_types(self): """checks the corner method returns the correct types""" my_geometry = odw.Geometry(h5m_filename=self.h5m_filename_smaller) @@ -65,12 +65,12 @@ def test_corners_expand_increases_size(self): """checks the expand increases the value returned""" my_geometry = odw.Geometry(h5m_filename=self.h5m_filename_smaller) small_corners = my_geometry.corners() - big_corners = my_geometry.corners(expand=(1,2,3)) + big_corners = my_geometry.corners(expand=(1, 2, 3)) - assert small_corners[0][0] -1 == big_corners[0][0] - assert small_corners[0][1] -2 == big_corners[0][1] - assert small_corners[0][2] -3 == big_corners[0][2] + assert small_corners[0][0] - 1 == big_corners[0][0] + assert small_corners[0][1] - 2 == big_corners[0][1] + assert small_corners[0][2] - 3 == big_corners[0][2] - assert small_corners[1][0] +1 == big_corners[1][0] - assert small_corners[1][1] +2 == big_corners[1][1] - assert small_corners[1][2] +3 == big_corners[1][2] + assert small_corners[1][0] + 1 == big_corners[1][0] + assert small_corners[1][1] + 2 == big_corners[1][1] + assert small_corners[1][2] + 3 == big_corners[1][2] From fbdb8df6492888d9d35123ad8ee92db907017778 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 8 Dec 2021 01:23:19 +0000 Subject: [PATCH 06/12] added geometry to tests --- .circleci/config.yml | 5 +++++ .github/workflows/ci_with_install.yml | 1 + run_tests.sh | 17 +++++++++-------- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9bba8b2..ae1d8bc 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,6 +30,11 @@ jobs: command: pytest tests/test_settings.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml + - run: + name: run tests Geometry() + command: + pytest tests/test_geometry.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml + - run: name: run tests Materials() command: diff --git a/.github/workflows/ci_with_install.yml b/.github/workflows/ci_with_install.yml index 7d670cd..971358c 100644 --- a/.github/workflows/ci_with_install.yml +++ b/.github/workflows/ci_with_install.yml @@ -32,6 +32,7 @@ jobs: pytest tests/test_neutronics_utils.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml pytest tests/test_example_neutronics_simulations.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml pytest tests/test_settings.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml + pytest tests/test_geometry.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml pytest tests/test_materials.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml pytest tests/test_tallies/ -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml pytest tests/test_system/ -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml diff --git a/run_tests.sh b/run_tests.sh index 6e9c081..d4d9052 100644 --- a/run_tests.sh +++ b/run_tests.sh @@ -1,8 +1,9 @@ -pytest tests/test_example_neutronics_simulations.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml -pytest tests/test_materials.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml -pytest tests/test_tallies/test_mesh_tallies.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml -pytest tests/test_system.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml -# pytest tests/test_neutronics_utils.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml -# pytest tests/test_reactor_neutronics.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml -# pytest tests/test_shape_neutronics.py -v --cov=openmc_dagmc_wrapper --cov-append --cov-report term --cov-report xml -python tests/notebook_testing.py \ No newline at end of file + +pytest tests/test_neutronics_utils.py -v +pytest tests/test_example_neutronics_simulations.py -v +pytest tests/test_settings.py -v +pytest tests/test_geometry.py -v +pytest tests/test_materials.py -v +pytest tests/test_tallies/ -v +pytest tests/test_system/ -v +python tests/notebook_testing.py -v From a673ebb18eb5f3dd3da44be94d21ec76459a4b7b Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 8 Dec 2021 10:21:52 +0000 Subject: [PATCH 07/12] using geometry.corners for bounding box --- tests/test_system/test_system_single_volume.py | 3 +-- tests/test_tallies/test_cell_tallies.py | 1 - tests/test_tallies/test_mesh_tally_2d.py | 7 +++---- tests/test_tallies/test_mesh_tally_3d.py | 6 +++--- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/test_system/test_system_single_volume.py b/tests/test_system/test_system_single_volume.py index 9fa1925..522050c 100644 --- a/tests/test_system/test_system_single_volume.py +++ b/tests/test_system/test_system_single_volume.py @@ -7,7 +7,6 @@ import neutronics_material_maker as nmm import openmc import openmc_dagmc_wrapper as odw -from dagmc_bounding_box import DagmcBoundingBox from remove_dagmc_tags import remove_tags @@ -271,7 +270,7 @@ def test_neutronics_component_2d_mesh_simulation(self): my_tallies = odw.MeshTallies2D( tally_types=["heating"], planes=["xy", "xz", "yz"], - bounding_box=DagmcBoundingBox(self.h5m_filename_smaller).corners(), + bounding_box=geometry.corners(), ) my_model = openmc.model.Model( diff --git a/tests/test_tallies/test_cell_tallies.py b/tests/test_tallies/test_cell_tallies.py index 6639b05..ed95143 100644 --- a/tests/test_tallies/test_cell_tallies.py +++ b/tests/test_tallies/test_cell_tallies.py @@ -3,7 +3,6 @@ import urllib.request from pathlib import Path -import openmc import openmc_dagmc_wrapper as odw diff --git a/tests/test_tallies/test_mesh_tally_2d.py b/tests/test_tallies/test_mesh_tally_2d.py index a9454ad..63d606e 100644 --- a/tests/test_tallies/test_mesh_tally_2d.py +++ b/tests/test_tallies/test_mesh_tally_2d.py @@ -6,7 +6,6 @@ import openmc import openmc_dagmc_wrapper as odw from openmc_plasma_source import FusionRingSource -from dagmc_bounding_box import DagmcBoundingBox class TestMeshTally2D(unittest.TestCase): @@ -59,19 +58,19 @@ def test_shape_of_resulting_png(self): tally1 = odw.MeshTally2D( tally_type="neutron_flux", plane="xy", - bounding_box=DagmcBoundingBox(self.h5m_filename_smaller).corners(), + bounding_box=geometry.corners(), mesh_resolution=(10, 200), ) tally2 = odw.MeshTally2D( tally_type="neutron_flux", plane="xz", - bounding_box=DagmcBoundingBox(self.h5m_filename_smaller).corners(), + bounding_box=geometry.corners(), mesh_resolution=(20, 100), ) tally3 = odw.MeshTally2D( tally_type="neutron_flux", plane="yz", - bounding_box=DagmcBoundingBox(self.h5m_filename_smaller).corners(), + bounding_box=geometry.corners(), mesh_resolution=(30, 500), ) diff --git a/tests/test_tallies/test_mesh_tally_3d.py b/tests/test_tallies/test_mesh_tally_3d.py index 72773b2..36d6a81 100644 --- a/tests/test_tallies/test_mesh_tally_3d.py +++ b/tests/test_tallies/test_mesh_tally_3d.py @@ -5,7 +5,6 @@ import openmc import openmc_dagmc_wrapper as odw -from dagmc_bounding_box import DagmcBoundingBox class TestMeshTally3D(unittest.TestCase): @@ -46,8 +45,9 @@ def incorrect_mesh_tally_3d_type(): def test_meshfilter_from_h5m_file(self): # build + geometry = odw.Geometry(self.h5m_filename_smaller) expected_mesh = openmc.RegularMesh(mesh_id=99, name="3d_mesh_expected") - bbox = DagmcBoundingBox(self.h5m_filename_smaller).corners() + bbox = geometry.corners() expected_mesh.lower_left = bbox[0] expected_mesh.upper_right = bbox[1] expected_mesh.dimension = (100, 100, 100) @@ -55,7 +55,7 @@ def test_meshfilter_from_h5m_file(self): # run my_tally = odw.MeshTally3D( "heating", - bounding_box=DagmcBoundingBox(self.h5m_filename_smaller).corners(), + bounding_box=geometry.corners(), ) produced_filter = my_tally.filters[-1] produced_mesh = produced_filter.mesh From 5acefa38482bc706a6e305e6ae2e8924d2cbde81 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 8 Dec 2021 10:24:03 +0000 Subject: [PATCH 08/12] [skip ci] removed todo --- tests/test_geometry.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_geometry.py b/tests/test_geometry.py index b8c079b..af7b68d 100644 --- a/tests/test_geometry.py +++ b/tests/test_geometry.py @@ -39,7 +39,6 @@ def test_attributes(self): my_geometry = odw.Geometry(h5m_filename=self.h5m_filename_smaller) assert my_geometry.reflective_angles is None assert my_geometry.graveyard_box is None - # TODO dagmc_bounding_box def test_corners_types(self): """checks the corner method returns the correct types""" From 5d1d912a28d99ca95744cb6d6623f08854455aa8 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 8 Dec 2021 14:29:20 +0000 Subject: [PATCH 09/12] fixing tests by using geometry.corners --- tests/test_system/test_system_single_volume.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_system/test_system_single_volume.py b/tests/test_system/test_system_single_volume.py index 522050c..6c71247 100644 --- a/tests/test_system/test_system_single_volume.py +++ b/tests/test_system/test_system_single_volume.py @@ -303,7 +303,7 @@ def test_neutronics_component_3d_mesh_simulation(self): my_tallies = odw.MeshTallies3D( tally_types=["heating", "(n,Xt)"], - bounding_box=DagmcBoundingBox(self.h5m_filename_smaller).corners(), + bounding_box=geometry.corners(), ) my_model = openmc.model.Model( @@ -338,13 +338,13 @@ def test_neutronics_component_3d_and_2d_mesh_simulation(self): my_3d_tally = odw.MeshTally3D( tally_type="heating", - bounding_box=DagmcBoundingBox(self.h5m_filename_smaller).corners(), + bounding_box=geometry.corners(), ) my_2d_tallies = odw.MeshTallies2D( planes=["xz", "xy", "yz"], tally_types=["heating"], - bounding_box=DagmcBoundingBox(self.h5m_filename_smaller).corners(), + bounding_box=geometry.corners(), ) my_model = openmc.model.Model( From f49d0ea9237915956b59552390686cbdf80c8769 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 8 Dec 2021 14:52:24 +0000 Subject: [PATCH 10/12] removed unused imports --- examples/regular_2d_mesh_tally_example.py | 5 ++--- examples/regular_3d_mesh_tally_example.py | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/regular_2d_mesh_tally_example.py b/examples/regular_2d_mesh_tally_example.py index f9930c1..58277f9 100644 --- a/examples/regular_2d_mesh_tally_example.py +++ b/examples/regular_2d_mesh_tally_example.py @@ -3,15 +3,14 @@ # Particular emphasis is placed on explaining the openmc-dagmc-wrapper # extentions of openmc base classes. -import tarfile -import urllib.request import openmc import openmc_dagmc_wrapper as odw from openmc_plasma_source import FusionRingSource -from dagmc_bounding_box import DagmcBoundingBox # downloads a dagmc file for use in the example +# import tarfile +# import urllib.request # url = "https://github.com/fusion-energy/neutronics_workflow/archive/refs/tags/v0.0.2.tar.gz" # urllib.request.urlretrieve(url, "v0.0.2.tar.gz") # tar = tarfile.open("v0.0.2.tar.gz", "r:gz") diff --git a/examples/regular_3d_mesh_tally_example.py b/examples/regular_3d_mesh_tally_example.py index 936506c..8cd8a05 100644 --- a/examples/regular_3d_mesh_tally_example.py +++ b/examples/regular_3d_mesh_tally_example.py @@ -3,15 +3,15 @@ # Particular emphasis is placed on explaining the openmc-dagmc-wrapper # extentions of openmc base classes. -import tarfile -import urllib.request import openmc import openmc_dagmc_wrapper as odw from openmc_plasma_source import FusionRingSource -from dagmc_bounding_box import DagmcBoundingBox + # downloads a dagmc file for use in the example +# import tarfile +# import urllib.request # url = "https://github.com/fusion-energy/neutronics_workflow/archive/refs/tags/v0.0.2.tar.gz" # urllib.request.urlretrieve(url, "v0.0.2.tar.gz") # tar = tarfile.open("v0.0.2.tar.gz", "r:gz") From 383a9339d6b5733d16f24fd59af7f32ebb524a5d Mon Sep 17 00:00:00 2001 From: remdelaportemathurin Date: Wed, 8 Dec 2021 15:59:03 +0100 Subject: [PATCH 11/12] fixed test --- tests/test_tallies/test_mesh_tally_2d.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_tallies/test_mesh_tally_2d.py b/tests/test_tallies/test_mesh_tally_2d.py index ae44c17..3a6efd6 100644 --- a/tests/test_tallies/test_mesh_tally_2d.py +++ b/tests/test_tallies/test_mesh_tally_2d.py @@ -94,22 +94,23 @@ def test_shape_of_resulting_png(self): def test_correct_resolution(self): """Tests that the mesh resolution is in accordance with the plane """ + geometry = odw.Geometry(h5m_filename=self.h5m_filename_smaller) tally_xy = odw.MeshTally2D( tally_type="neutron_flux", plane="xy", - bounding_box=DagmcBoundingBox(self.h5m_filename_smaller).corners(), + bounding_box=geometry.corners(), mesh_resolution=(10, 20), ) tally_yz = odw.MeshTally2D( tally_type="neutron_flux", plane="yz", - bounding_box=DagmcBoundingBox(self.h5m_filename_smaller).corners(), + bounding_box=geometry.corners(), mesh_resolution=(10, 20), ) tally_xz = odw.MeshTally2D( tally_type="neutron_flux", plane="xz", - bounding_box=DagmcBoundingBox(self.h5m_filename_smaller).corners(), + bounding_box=geometry.corners(), mesh_resolution=(10, 20), ) From e0aa03d5d215e1cc94dbd4551a8f148d485febbd Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Wed, 8 Dec 2021 14:59:33 +0000 Subject: [PATCH 12/12] removed DagmcBoundingBox --- tests/test_tallies/test_mesh_tally_2d.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_tallies/test_mesh_tally_2d.py b/tests/test_tallies/test_mesh_tally_2d.py index ae44c17..3a6efd6 100644 --- a/tests/test_tallies/test_mesh_tally_2d.py +++ b/tests/test_tallies/test_mesh_tally_2d.py @@ -94,22 +94,23 @@ def test_shape_of_resulting_png(self): def test_correct_resolution(self): """Tests that the mesh resolution is in accordance with the plane """ + geometry = odw.Geometry(h5m_filename=self.h5m_filename_smaller) tally_xy = odw.MeshTally2D( tally_type="neutron_flux", plane="xy", - bounding_box=DagmcBoundingBox(self.h5m_filename_smaller).corners(), + bounding_box=geometry.corners(), mesh_resolution=(10, 20), ) tally_yz = odw.MeshTally2D( tally_type="neutron_flux", plane="yz", - bounding_box=DagmcBoundingBox(self.h5m_filename_smaller).corners(), + bounding_box=geometry.corners(), mesh_resolution=(10, 20), ) tally_xz = odw.MeshTally2D( tally_type="neutron_flux", plane="xz", - bounding_box=DagmcBoundingBox(self.h5m_filename_smaller).corners(), + bounding_box=geometry.corners(), mesh_resolution=(10, 20), )