mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Requested changes for PR
Modified data.py to align with OpenMC Python convention, added more elegant check for element names
This commit is contained in:
parent
bf7f7327a5
commit
d9b2c4dccc
2 changed files with 4 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ import os
|
|||
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
|
||||
|
|
|
|||
|
|
@ -530,8 +530,9 @@ class Material(IDManagerMixin):
|
|||
# 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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue