Skip to content

Commit

Permalink
Requested changes for PR
Browse files Browse the repository at this point in the history
Modified data.py to align with OpenMC Python convention,
added more elegant check for element names
  • Loading branch information
ChasingNeutrons committed Feb 27, 2020
1 parent bf7f732 commit d9b2c4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions openmc/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import re
from warnings import warn


# Isotopic abundances from Meija J, Coplen T B, et al, "Isotopic compositions
# of the elements 2013 (IUPAC Technical Report)", Pure. Appl. Chem. 88 (3),
# pp. 293-306 (2013). The "representative isotopic abundance" values from
Expand Down
5 changes: 3 additions & 2 deletions openmc/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,9 @@ def add_element(self, element, percent, percent_type='ao', enrichment=None):
# Allow for element identifier to be given as a symbol or name
if len(element)>2:
el = element.lower()
element = openmc.data.ELEMENT_SYMBOL.get(el,"empty")
if element == "empty":
if el in openmc.data.ELEMENT_SYMBOL:
element = openmc.data.ELEMENT_SYMBOL[el]
else:
msg = 'Element name "{}" not recognised'.format(el)
raise ValueError(msg)

Expand Down

0 comments on commit d9b2c4d

Please sign in to comment.