From 8478a577e34594b951be8f28009a6927fc14731c Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 7 Nov 2019 14:58:31 -0600 Subject: [PATCH] Correcting return type in Geometry object and making get_all_cells/get_all_materials consistent there. --- openmc/geometry.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openmc/geometry.py b/openmc/geometry.py index 196c38845..2d8c57989 100644 --- a/openmc/geometry.py +++ b/openmc/geometry.py @@ -279,7 +279,7 @@ class Geometry(object): if self.root_universe is not None: return self.root_universe.get_all_cells(memo) else: - return [] + return OrderedDict() def get_all_universes(self): """Return all universes in the geometry. @@ -308,7 +308,10 @@ class Geometry(object): """ memo = set() - return self.root_universe.get_all_materials(memo) + if self.root_universe is not None: + return self.root_universe.get_all_materials(memo) + else: + return OrderedDict() def get_all_material_cells(self): """Return all cells filled by a material