montepy.data_inputs.element module#
Classes:
|
Class to represent an element e.g., Aluminum. |
- class montepy.data_inputs.element.Element(Z: int)#
Bases:
SingletonGroup
Class to represent an element e.g., Aluminum.
Note
This class is immutable, and hashable, meaning it is suitable as a dictionary key.
- Parameters:
Z (int) – the Z number of the element
- Raises:
UnknownElement – if there is no element with that Z number.
Methods:
get_by_name
(name)Get an element by it's name.
get_by_symbol
(symbol)Get an element by it's symbol.
Attributes:
The atomic number for this Element.
The name of the element.
The atomic symbol for this Element.
- classmethod get_by_name(name: str) Element #
Get an element by it’s name.
E.g., get the element with Z=1 from “hydrogen”.
- Returns:
the element with this name
- Return type:
- Raises:
UnknownElement – if there is no element with that name.
- Parameters:
name (str)
- classmethod get_by_symbol(symbol: str) Element #
Get an element by it’s symbol.
E.g., get the element with Z=1 from “H”.
- Returns:
the element with this symbol
- Return type:
- Raises:
UnknownElement – if there is no element with that symbol.
- Parameters:
symbol (str)
- property Z: int#
The atomic number for this Element.
- Returns:
the atomic number
- Return type:
int
- property name: str#
The name of the element.
- Returns:
the element’s name.
- Return type:
str
- property symbol: str#
The atomic symbol for this Element.
- Returns:
the atomic symbol
- Return type:
str