montepy.Element#
- class montepy.Element(Z: ~typing.Annotated[~numbers.Integral, <function positive at 0x76642e5f5300>])#
Bases:
SingletonGroupClass 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(cls, name)Get an element by it's name.
get_by_symbol(cls, 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(cls, 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(cls, 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