nuclide¶
Nuclide name parsing, including the spellings the regulations use.
nuclide
¶
Nuclide name parsing, validation and normalisation.
The canonical form used throughout this package is the one OpenMC and GND use,
Co60 and Ag108_m1, because the most common source of an inventory is an
OpenMC material and matching it avoids a translation layer at the boundary.
Regulatory tables spell nuclides differently again (Co-60, Ag-108m,
U-238sec, Sr-90+), so parse_regulatory handles those and
separates the secular-equilibrium marker from the nuclide identity.
Classes:
-
NuclideNameError–Raised when a string cannot be read as a single nuclide.
Functions:
-
atomic_number–Return the proton number of a nuclide, for example 27 for
Co60. -
element–Return the element symbol of a nuclide, for example
CoforCo60. -
is_valid–Whether a value can be read as a single nuclide.
-
mass_number–Return the mass number of a nuclide, for example 60 for
Co60. -
metastable_state–Return the metastable level of a nuclide, 0 for a ground state.
-
normalise–Return a nuclide name in canonical form.
-
parse–Split a nuclide name into element symbol, mass number and metastable level.
-
parse_regulatory–Read a nuclide name as spelled in a regulatory table.
NuclideNameError
¶
Bases: builtins.ValueError
Raised when a string cannot be read as a single nuclide.
Attributes:
-
__doc__–str(object='') -> str
-
__module__–str(object='') -> str
-
__weakref__–list of weak references to the object
__doc__
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__module__
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
atomic_number
builtin
¶
Return the proton number of a nuclide, for example 27 for Co60.
element
builtin
¶
Return the element symbol of a nuclide, for example Co for Co60.
mass_number
builtin
¶
Return the mass number of a nuclide, for example 60 for Co60.
metastable_state
builtin
¶
Return the metastable level of a nuclide, 0 for a ground state.
normalise
builtin
¶
Return a nuclide name in canonical form.
Co-60 and co 60 both become Co60; Ag-108m becomes
Ag108_m1 and Hf-178n becomes Hf178_m2. A trailing + is
stripped, since it marks a secular equilibrium value rather than a different
nuclide, but sec is not accepted here because a sec value is a
separate table entry. Use parse_regulatory when reading a regulatory
table.
Parameters:
Returns:
-
str–The canonical name, such as
Co60orAg108_m1.
Raises:
-
NuclideNameError–If the name is not a single nuclide.
parse
builtin
¶
Split a nuclide name into element symbol, mass number and metastable level.
Parameters:
Returns:
-
str–(symbol, mass_number, metastable_level), where the level is 0 for a -
int–ground state and 1 or 2 for a metastable state. The symbol is returned
-
int–in its canonical capitalisation regardless of the input's.
Raises:
-
NuclideNameError–If the name is not a single nuclide. A bare element such as
Feraises, because a clearance limit applies to a nuclide and silently guessing a mass number would be wrong.
parse_regulatory
builtin
¶
Read a nuclide name as spelled in a regulatory table.
Regulatory tables mark parent nuclides whose limit already accounts for
daughters in secular equilibrium, with + for the daughters tabulated
alongside and sec for the whole decay chain. The marker is not part of
the nuclide's identity but it does select a different limit value, so it is
returned separately rather than discarded.
Parameters:
Returns:
Raises:
-
NuclideNameError–If the label is not a single nuclide.