fix errorneous behavior when adding metastable nuclides via add_components

This commit is contained in:
yardasol 2022-09-01 11:52:21 -05:00
parent b0b37119f2
commit 0214b22036
2 changed files with 3 additions and 1 deletions

View file

@ -438,7 +438,8 @@ class Material(IDManagerMixin):
params['percent_type'] = percent_type
## check if nuclide
if str.isdigit(component[-1]):
if str.isdigit(component[-1]) or (component[-1] == 'm'
and str.isdigit(component[-2])):
self.add_nuclide(component, **params)
else: # is element
kwargs = params

View file

@ -32,6 +32,7 @@ def test_add_components():
'O16': 1.0,
'Zr': 1.0,
'O': 1.0,
'Ag110m': 1.0,
'U': {'percent': 1.0,
'enrichment': 4.5},
'Li': {'percent': 1.0,