From 72f639800ab52a7fa9b424fdbb94471fa6ef5762 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Wed, 22 Apr 2015 01:31:32 -0500 Subject: [PATCH] Updated id setter for Material --- src/utils/openmc/material.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/openmc/material.py b/src/utils/openmc/material.py index 483a8953a2..d3baf39122 100644 --- a/src/utils/openmc/material.py +++ b/src/utils/openmc/material.py @@ -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: