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