Element
jaff.core.elements.Element
The Element class represents a chemical element loaded from the JAFF mass dictionary. It uses the flyweight pattern: constructing Element("H") twice returns the same object, with all fields populated only on the first construction.
Constructor
Element(symbol)
Parameters
- symbol : str
- Periodic-table symbol (case-sensitive), e.g.
"H","He". Must exist in the JAFF mass dictionary.
Attributes
| Attribute | Type | Description |
|---|---|---|
symbol |
str |
Periodic-table symbol (e.g. "H", "He") |
name |
str |
Full element name as stored in the mass dictionary (e.g. "hydrogen") |
mass |
float |
Mass of the most common isotope in grams (CGS) |
atomic_mass |
float |
Standard atomic weight in atomic mass units |
protons |
int |
Number of protons (atomic number) |
neutrons |
int |
Number of neutrons in the most common isotope |
electrons |
int |
Number of electrons in the neutral atom |