From e204952c369cc7181fbc74842956e991f84c5953 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Tue, 26 Apr 2016 23:26:16 -0400 Subject: [PATCH] Alow string shortcut to Material.add_element --- openmc/material.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/material.py b/openmc/material.py index c6030a8e67..17283d4ddc 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -387,7 +387,7 @@ class Material(object): Parameters ---------- - element : openmc.Element + element : openmc.Element or str Element to add percent : float Atom or weight percent @@ -401,7 +401,7 @@ class Material(object): 'macroscopic data-set has already been added'.format(self._id) raise ValueError(msg) - if not isinstance(element, openmc.Element): + if not isinstance(element, (openmc.Element, str)): msg = 'Unable to add an Element to Material ID="{0}" with a ' \ 'non-Element value "{1}"'.format(self._id, element) raise ValueError(msg)