Skip to content

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:

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 Co for Co60.

  • 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__ class-attribute

__doc__ = 'Raised when a string cannot be read as a single nuclide.'

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

__module__ = 'radiological_material_clearance_finder._core'

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'.

__weakref__ property

__weakref__

list of weak references to the object

atomic_number builtin

atomic_number(name: str) -> int

Return the proton number of a nuclide, for example 27 for Co60.

element builtin

element(name: str) -> str

Return the element symbol of a nuclide, for example Co for Co60.

is_valid builtin

is_valid(name: object) -> bool

Whether a value can be read as a single nuclide.

mass_number builtin

mass_number(name: str) -> int

Return the mass number of a nuclide, for example 60 for Co60.

metastable_state builtin

metastable_state(name: str) -> int

Return the metastable level of a nuclide, 0 for a ground state.

normalise builtin

normalise(name: str) -> str

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:

  • name

    (str) –

    A nuclide name in any accepted spelling.

Returns:

  • str –

    The canonical name, such as Co60 or Ag108_m1.

Raises:

parse builtin

parse(name: str) -> tuple[str, int, int]

Split a nuclide name into element symbol, mass number and metastable level.

Parameters:

  • name

    (str) –

    A nuclide name in any accepted spelling, such as Co60, Co-60, Ag-108m or Ag108_m1.

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 Fe raises, because a clearance limit applies to a nuclide and silently guessing a mass number would be wrong.

parse_regulatory builtin

parse_regulatory(label: str) -> tuple[str, Literal['+', 'sec'] | None]

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:

  • label

    (str) –

    A table cell such as Sr-90+, U-238sec or Th-232 sec.

Returns:

  • str –

    (canonical_name, marker) where marker is "+", "sec" or

  • Literal['+', 'sec'] | None –

    None.

Raises: