| 1 |
""" |
| 2 |
Example of isotope specific extensions to the periodic table. |
| 3 |
""" |
| 4 |
from periodictable.core import Isotope |
| 5 |
|
| 6 |
def init(table, reload=False): |
| 7 |
if 'shells' in table.properties and not reload: return |
| 8 |
table.properties.append('shells') |
| 9 |
|
| 10 |
# Set the default. This is required, even if it is only |
| 11 |
# setting it to None. If the attribute is missing then |
| 12 |
# the isotope data reverts to the element to supply the |
| 13 |
# value, which is almost certainly not what you want. |
| 14 |
Isotope.shells = None |
| 15 |
|
| 16 |
# Load the data |
| 17 |
for symbol,eldata in data.items(): |
| 18 |
el = table.symbol(symbol) |
| 19 |
for iso,isodata in eldata.items(): |
| 20 |
el[iso].shells = isodata |
| 21 |
|
| 22 |
# Define the data |
| 23 |
data = dict( |
| 24 |
Fe = {56: "56-Fe shell info", |
| 25 |
58: "58-Fe shell info", |
| 26 |
}, |
| 27 |
) |