mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Updated id setter for Material
This commit is contained in:
parent
5dac75297d
commit
72f639800a
1 changed files with 3 additions and 3 deletions
|
|
@ -38,8 +38,8 @@ class Material(object):
|
|||
def __init__(self, material_id=None, name=''):
|
||||
|
||||
# Initialize class attributes
|
||||
self._id = material_id
|
||||
self._name = name
|
||||
self.id = material_id
|
||||
self.name = name
|
||||
self._density = None
|
||||
self._density_units = ''
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ class Material(object):
|
|||
global AUTO_MATERIAL_ID, MATERIAL_IDS
|
||||
|
||||
# If the Material already has an ID, remove it from global list
|
||||
if not self._id is None:
|
||||
if hasattr(self, '_id') and not self._id is None:
|
||||
MATERIAL_IDS.remove(self._id)
|
||||
|
||||
if material_id is None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue