From c3e60da1b9f2c04545200e8d5f16360304c166ca Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Thu, 14 Jul 2022 16:55:26 +0100 Subject: [PATCH] testing and returing openmc.Universe --- openmc/universe.py | 12 ++++++------ tests/regression_tests/dagmc/universes/test.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openmc/universe.py b/openmc/universe.py index 9931724fb..811b27b31 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -762,18 +762,18 @@ class DAGMCUniverse(UniverseBase): return +lower_x & -upper_x & +lower_y & -upper_y & +lower_z & -upper_z def bounded_universe(self, **kwargs): - """Returns an openmc.Cell that bounds the DAGMCUniverse and is filled - with the DAGMCUniverse. Defaults to a box cell with a vacuum surface. - kwargs are passed directly to DAGMCUniverse.bounding_region() + """Returns an openmc.Universe filled with this DAGMCUniverse and bounded + with a cell. Defaults to a box cell with a vacuum surface. kwargs are + passed directly to DAGMCUniverse.bounding_region() Returns ------- - openmc.Cell - cell filled with the DAGMCUniverse + openmc.Universe + Universe instance """ bounding_cell = openmc.Cell(fill=self, region=self.bounding_region(**kwargs)) - return bounding_cell + return openmc.Universe(cells=[bounding_cell]) @classmethod def from_hdf5(cls, group): diff --git a/tests/regression_tests/dagmc/universes/test.py b/tests/regression_tests/dagmc/universes/test.py index 7abd80ef7..f2eb3882f 100644 --- a/tests/regression_tests/dagmc/universes/test.py +++ b/tests/regression_tests/dagmc/universes/test.py @@ -47,9 +47,9 @@ class DAGMCUniverseTest(PyAPITestHarness): pincell_univ = openmc.DAGMCUniverse(filename='dagmc.h5m', auto_geom_ids=True) # creates another DAGMC universe, this time with within a bounded cell - bound_pincell_cell = openmc.DAGMCUniverse(filename='dagmc.h5m').bounded_universe() + bound_pincell_universe = openmc.DAGMCUniverse(filename='dagmc.h5m').bounded_universe() # uses the bound_dag_cell as the root argument to test the type checks in openmc.Geometry - bound_pincell_geometry = openmc.Geometry(root=[bound_pincell_cell]) + bound_pincell_geometry = openmc.Geometry(root=bound_pincell_universe) # assigns the bound_dag_geometry to the model to test the type checks in model.Geometry setter model.Geometry = bound_pincell_geometry