mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Now using id property setters in Python Summary API
This commit is contained in:
parent
b671b1a299
commit
ffd0070654
2 changed files with 5 additions and 9 deletions
|
|
@ -194,10 +194,6 @@ class Material(object):
|
|||
def id(self, material_id):
|
||||
global AUTO_MATERIAL_ID, MATERIAL_IDS
|
||||
|
||||
# If the Material already has an ID, remove it from global list
|
||||
if hasattr(self, '_id') and self._id is not None:
|
||||
MATERIAL_IDS.remove(self._id)
|
||||
|
||||
if material_id is None:
|
||||
self._id = AUTO_MATERIAL_ID
|
||||
MATERIAL_IDS.append(AUTO_MATERIAL_ID)
|
||||
|
|
|
|||
|
|
@ -567,7 +567,7 @@ class Summary(object):
|
|||
"""
|
||||
|
||||
for index, material in self.materials.items():
|
||||
if material._id == material_id:
|
||||
if material.id == material_id:
|
||||
return material
|
||||
|
||||
return None
|
||||
|
|
@ -588,7 +588,7 @@ class Summary(object):
|
|||
"""
|
||||
|
||||
for index, surface in self.surfaces.items():
|
||||
if surface._id == surface_id:
|
||||
if surface.id == surface_id:
|
||||
return surface
|
||||
|
||||
return None
|
||||
|
|
@ -609,7 +609,7 @@ class Summary(object):
|
|||
"""
|
||||
|
||||
for index, cell in self.cells.items():
|
||||
if cell._id == cell_id:
|
||||
if cell.id == cell_id:
|
||||
return cell
|
||||
|
||||
return None
|
||||
|
|
@ -630,7 +630,7 @@ class Summary(object):
|
|||
"""
|
||||
|
||||
for index, universe in self.universes.items():
|
||||
if universe._id == universe_id:
|
||||
if universe.id == universe_id:
|
||||
return universe
|
||||
|
||||
return None
|
||||
|
|
@ -651,7 +651,7 @@ class Summary(object):
|
|||
"""
|
||||
|
||||
for index, lattice in self.lattices.items():
|
||||
if lattice._id == lattice_id:
|
||||
if lattice.id == lattice_id:
|
||||
return lattice
|
||||
|
||||
return None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue