From a04c1adcd2c869658907f3885730faf6552fea8e Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 1 Apr 2020 13:43:43 -0500 Subject: [PATCH] Changes in universe.py from PullRequest Inc. review --- openmc/universe.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openmc/universe.py b/openmc/universe.py index b5bcd866e2..04f2f219d7 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -54,7 +54,7 @@ class Universe(IDManagerMixin): self._volume = None self._atoms = {} - # Keys - Cell IDs + # Keys - Cell IDs # Values - Cells self._cells = OrderedDict() @@ -63,10 +63,9 @@ class Universe(IDManagerMixin): def __repr__(self): string = 'Universe\n' - string += '{0: <16}{1}{2}\n'.format('\tID', '=\t', self._id) - string += '{0: <16}{1}{2}\n'.format('\tName', '=\t', self._name) - string += '{0: <16}{1}{2}\n'.format('\tCells', '=\t', - list(self._cells.keys())) + string += '{: <16}=\t{}\n'.format('\tID', self._id) + string += '{: <16}=\t{}\n'.format('\tName', self._name) + string += '{: <16}=\t{}\n'.format('\tCells', list(self._cells.keys())) return string @property @@ -542,7 +541,7 @@ class Universe(IDManagerMixin): """ # Iterate over all Cells - for cell_id, cell in self._cells.items(): + for cell in self._cells.values(): # If the cell was already written, move on if memo and cell in memo: