Changes in universe.py from PullRequest Inc. review

This commit is contained in:
Paul Romano 2020-04-01 13:43:43 -05:00
parent cceaa10893
commit a04c1adcd2

View file

@ -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: