Skip to content

Commit 5b21c3d

Browse files
authored
Merge pull request #27 from theochem/add_periodic_module
Add new periodic module and tests
2 parents 761b63e + 0fab57b commit 5b21c3d

File tree

4 files changed

+266
-0
lines changed

4 files changed

+266
-0
lines changed

atomdb/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
from atomdb.promolecule import *
2626

27+
from atomdb.periodic import *
28+
2729

2830
__version__ = version
2931
r"""AtomDB version string."""

atomdb/data/data_info.csv

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#Property key,Property name,Source key,units,Property description,Reference,doi,Notes
2+
cov_radius,Covalent radius,cordero,angstrom,Covalent radius (derived from crystallographic data),"B. Cordero, V. Gomez, A. E. Platero-Prats, M. Reves, J. Echeverria,E. Cremades,\nF. Barragan, and S. Alvarez, Dalton Trans. pp. 2832--2838 (2008)",http://dx.doi.org/10.1039/b801115j,"For carbon the number is a weighted average over the data for different hybridizations.\nFor Mn, Fe, and Co, the number is a weighted average over the data for different spins\n(high spin and low spin)"
3+
cov_radius,Covalent radius,bragg,angstrom,"Bragg radius (covalent, metallic and ionic bonds, derived from crystallographic data)","W. L. Bragg, Phil. Mag. 40, 169 (1920)",http://dx.doi.org/10.1080/14786440808636111,
4+
cov_radius,Covalent radius,slater,angstrom,"Slater radius (covalent, metallic and ionic bonds, derived from crystallographic data)","J. C. Slater, J. Chem. Phys. 41, 3199 (1964)",http://dx.doi.org/10.1063/1.1725697,
5+
vdw_radius,van der Waals radius,bondi,angstrom,van der Waals radius according to Bondi,"A. Bondi, J. Phys. Chem. 68, 441 (1964)",http://dx.doi.org/10.1021/j100785a001,
6+
vdw_radius,van der Waals radius,truhlar,angstrom,van der Waals radii by Truhlar (corrections and additions to Bondi),M. Mantina A. C. Chamberlin R. Valero C. J. Cramer D. G. Truhlar J. Phys. Chem. A 113 5806 (2009),http://dx.doi.org/10.1021/jp8111556,
7+
vdw_radius,van der Waals radius,rt,angstrom,van der Waals radius according to Rowland and Taylor,"R. S. Rowland and R. Taylor, J. Phys. Chem. 100, 7384 (1996)",http://dx.doi.org/10.1021/jp953141+,
8+
vdw_radius,van der Waals radius,batsanov,angstrom,van der Waals radii by Batsanov,S. S. Batsanov Inorganic Materials 37 871 (2001),http://dx.doi.org/10.1023/a%3a1011625728803,
9+
vdw_radius,van der Waals radius,dreiding,2angstrom,van der Waals radii from the DREIDING FF,"Stephen L. Mayo, Barry D. Olafson, and William A. Goddard III J. Phys. Chem. 94 8897 (1990)",http://dx.doi.org/10.1021/j100389a010,"R_0 parameter, unit 2angstrom is used so that numbers are divided by 2 upon reading"
10+
vdw_radius,van der Waals radius,uff,2angstrom,van der Waals radii from UFF ,"A. K. Rappi, C. J. Casewit, K. S. Colwell, W. A. Goddard III, and W. M. Skid J. Am. Chem. Soc. 114 10024 (1992)",http://dx.doi.org/10.1021/ja00051a040,"x_I parameter, unit 2angstrom is used so that numbers are divided by 2 upon reading"
11+
vdw_radius,van der Waals radius,mm3,angstrom,van der Waals radii from MM3,"N. L. Allinger, X. Zhou, and J. Bergsma, Journal of Molecular Structure: THEOCHEM 312, 69 (1994)",http://dx.doi.org/10.1016/s0166-1280(09)80008-0,
12+
at_radius,atomic radius,wc,angstrom,Waber-Cromer atomic radius,"J. T. Waber and D. T. Cromer, J. Chem. Phys. 42, 4116 (1965)",http://dx.doi.org/10.1063/1.1695904,"For each element, the largest radius of the outer orbitals is taken."
13+
at_radius,atomic radius,cr,angstrom,Clementi-Raimondi atomic radius,"E. Clementi, D. L. Raimondi, W. P. Reinhardt, J. Chem. Phys. 47, 1300 (1967)",http://dx.doi.org/10.1063/1.1712084,
14+
eneg,Electronegativity,pauling,,Pauling electronegativity,"A. L. Allred, J. Inorg. Nuc. Chem. 17, 215 (1961)",http://dx.doi.org/10.1016/0022-1902(61)80142-5,
15+
pold,Isolated atom dipole polarizability,crc,angstrom**3,Isolated atom dipole polarizability,"CRC Handbook of Chemistry and Physics (CRC, Boca Raton, FL, 2003).",,"If multiple values were present in the CRC book, the value used in Erin's postg code is taken"
16+
pold,Isolated atom dipole polarizability,chu,au,Isolated atom dipole polarizability,"X. Chu & A. Dalgarno, J. Chem. Phys., 121(9), 4083–4088 (2004)",http://dx.doi.org/10.1063/1.1779576,"Theoretical value for hydrogen from this paper:\nA.D. Buckingham, K.L. Clarke, Chem. Phys. Lett. 57(3), 321--325 (1978)\nhttp://dx.doi.org/10.1016/0009-2614(78)85517-1"
17+
c6,Isolated atom C6 dispersion coefficients,chu,au,Isolated atom C6 dispersion coefficients,"X. Chu & A. Dalgarno, J. Chem. Phys., 121(9), 4083–4088 (2004)",http://dx.doi.org/10.1063/1.1779576,"Theoretical value for hydrogen from this paper:\nK. T. Tang, J. M. Norbeck and P. R. Certain, J. Chem. Phys. 64, 3063 (1976)\nhttp://dx.doi.org/10.1063/1.432569"
18+
mass,Atomic mass,stb,amu,IUPAC atomic mass (or weight for the chemists),"Thomas Prohaska et. al. Pure Appl. Chem. 2022, 94",https://doi.org/10.1515/pac-2019-0603,

atomdb/data/elements_data.csv

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
#Periodic Table data.,,,,,,,,,,,,,,,,,,,,,,
2+
# First row indicates the property,,,,,,,,,,,,,,,,,,,,,,
3+
# Second row indicates the source/alternative for a given property (can be empty) it is used to link the references with the values,,,,,,,,,,,,,,,,,,,,,,
4+
# Third row indicates the units,,,,,,,,,,,,,,,,,,,,,,
5+
,,,,,,,,,,,,,,,,,,,,,,
6+
atnum,symbol,name,group,period,multiplicity,cov_radius,cov_radius,cov_radius,vdw_radius,vdw_radius,vdw_radius,vdw_radius,vdw_radius,vdw_radius,vdw_radius,at_radius,at_radius,eneg,pold,pold,c6,mass
7+
,,,,,,cordero,bragg,slater,bondi,truhlar,rt,batsanov,dreiding,uff,mm3,wc,cr,pauling,crc,chu,chu,stb
8+
int,str,str,int,int,int,angstrom,angstrom,angstrom,angstrom,angstrom,angstrom,angstrom,2angstrom,2angstrom,angstrom,angstrom,angstrom,float,angstrom**3,au,au,amu
9+
1,H,Hydrogen,1,1,2,0.31,,0.25,1.2,,1.1,,3.195,2.886,1.62,0.529192875,0.53,2.2,0.666793,4.5,6.499026705,1.007975
10+
2,He,Helium,18,1,1,0.28,,,1.4,,,,,2.362,1.53,0.291,0.31,,0.204956,1.38,1.42,4.002602
11+
3,Li,Lithium,1,2,2,1.28,1.5,1.45,1.81,,,2.2,,2.451,2.55,1.586,1.67,0.98,24.3,164,1392,6.9675
12+
4,Be,Beryllium,2,2,1,0.96,1.15,1.05,,1.53,,1.9,,2.745,2.23,1.04,1.12,1.57,5.6,38,227,9.0121831
13+
5,B,Boron,13,2,2,0.84,,0.85,,1.92,,1.8,4.02,4.083,2.15,0.776,0.87,2.04,3.03,21,99.5,10.8135
14+
6,C,Carbon,14,2,3,0.7445337366,0.77,0.7,1.7,,1.77,1.7,3.8983,3.851,2.04,0.62,0.67,2.55,1.76,12,46.6,12.0106
15+
7,N,Nitrogen,15,2,4,0.71,0.65,0.65,1.55,,1.64,1.6,3.6621,3.66,1.93,0.521,0.56,3.04,1.1,7.4,24.2,14.006855
16+
8,O,Oxygen,16,2,3,0.66,0.65,0.6,1.52,,1.58,1.55,3.4046,3.5,1.82,0.45,0.48,3.44,0.802,5.4,15.6,15.9994
17+
9,F,Fluorine,17,2,2,0.57,0.67,0.5,1.47,,1.46,1.5,3.472,3.364,1.71,0.396,0.42,3.98,0.557,3.8,9.52,18.998403163
18+
10,Ne,Neon,18,2,1,0.58,,,1.54,,1.81,,,3.243,1.6,0.354,0.38,,0.3956,2.67,6.2,20.1797
19+
11,Na,Sodium,1,3,2,1.66,1.77,1.8,2.27,,1.76,2.4,,2.983,2.7,1.713,1.9,0.93,24.11,163,1518,22.98976928
20+
12,Mg,Magnesium,2,3,1,1.41,1.42,1.5,1.73,,1.87,2.2,,3.021,2.43,1.279,1.45,1.31,10.6,71,626,24.3055
21+
13,Al,Aluminium,13,3,2,1.21,1.35,1.25,,1.84,2.03,2.1,4.39,4.499,2.36,1.312,1.18,1.61,6.8,60,528,26.9815385
22+
14,Si,Silicon,14,3,3,1.11,1.17,1.1,2.1,,,2.1,4.27,4.295,2.29,1.068,1.11,1.9,5.38,37,305,28.085
23+
15,P,Phosphorus,15,3,4,1.07,,1,1.8,,,1.95,4.15,4.147,2.22,0.919,0.98,2.19,3.63,25,185,30.973761998
24+
16,S,Sulfur,16,3,3,1.05,1.02,1,1.8,,,1.8,4.03,4.035,2.15,0.81,0.88,2.58,2.9,19.6,134,32.0675
25+
17,Cl,Chlorine,17,3,2,1.02,1.05,1,1.75,,,1.8,3.9503,3.947,2.07,0.725,0.79,3.16,2.18,15,94.6,35.4515
26+
18,Ar,Argon,18,3,1,1.06,,,1.88,,,,,3.868,1.99,0.659,0.71,,1.6411,11.1,64.2,39.948
27+
19,K,Potassium,1,4,2,2.03,2.07,2.2,2.75,,,2.8,,3.812,3.09,2.162,2.43,0.82,43.4,294,3923,39.0983
28+
20,Ca,Calcium,2,4,1,1.76,1.7,1.8,,2.31,,2.4,,3.399,2.81,1.69,1.94,1,22.8,160,2163,40.078
29+
21,Sc,Scandium,3,4,2,1.7,,1.6,,,,2.3,,3.295,2.61,1.57,1.84,1.36,17.8,120,1383,44.955908
30+
22,Ti,Titanium,4,4,3,1.6,1.4,1.4,,,,2.15,,3.175,2.39,1.477,1.76,1.54,14.6,98,1044,47.867
31+
23,V,Vanadium,5,4,4,1.53,,1.35,,,,2.05,,3.144,2.29,1.401,1.71,1.63,12.4,84,832,50.9415
32+
24,Cr,Chromium,6,4,7,1.39,1.4,1.4,,,,2.05,,3.023,2.25,1.453,1.66,1.66,11.6,78,602,51.9961
33+
25,Mn,Manganese,7,4,6,1.553504,1.47,1.4,,,,2.05,,2.961,2.24,1.278,1.61,1.55,9.4,63,552,54.938044
34+
26,Fe,Iron,8,4,5,1.4841791045,1.4,1.4,,,,2.05,,2.912,2.23,1.227,1.56,1.83,8.4,56,482,55.845
35+
27,Co,Cobalt,9,4,4,1.2975449102,1.37,1.35,,,,2,,2.872,2.23,1.181,1.52,1.88,7.5,50,408,58.933194
36+
28,Ni,Nickel,10,4,3,1.24,1.35,1.35,,,,2,,2.834,2.22,1.139,1.49,1.91,6.8,48,373,58.6934
37+
29,Cu,Copper,11,4,2,1.32,1.37,1.35,,,,2,,3.495,2.26,1.191,1.45,1.9,6.2,42,253,63.546
38+
30,Zn,Zinc,12,4,1,1.22,1.32,1.35,,,,2.1,,2.763,2.29,1.065,1.42,1.65,5.75,40,284,65.38
39+
31,Ga,Gallium,13,4,2,1.22,,1.3,1.87,,,2.1,4.39,4.383,2.46,1.254,1.36,1.81,8.12,60,498,69.723
40+
32,Ge,Germanium,14,4,3,1.2,,1.25,,2.11,,2.1,4.27,4.28,2.44,1.09,1.25,2.01,6.07,41,354,72.63
41+
33,As,Arsenic,15,4,4,1.19,1.26,1.15,1.85,,,2.05,4.15,4.23,2.36,1.001,1.14,2.18,4.31,29,246,74.921595
42+
34,Se,Selenium,16,4,3,1.2,1.17,1.15,1.9,,,1.9,4.03,4.205,2.29,0.918,1.03,2.55,3.77,25,210,78.971
43+
35,Br,Bromine,17,4,2,1.2,1.19,1.15,1.83,,,1.9,3.95,4.189,2.22,0.851,0.94,2.96,3.05,20,162,79.904
44+
36,Kr,Krypton,18,4,1,1.16,,,2.02,,,,,4.141,2.15,0.795,0.88,,2.4844,16.7,130,83.798
45+
37,Rb,Rubidium,1,5,2,2.2,2.25,2.35,,3.03,,2.9,,4.114,3.25,2.287,2.65,0.82,47.3,320,4769,85.4678
46+
38,Sr,Strontium,2,5,1,1.95,1.95,2,,2.49,,2.55,,3.641,3,1.836,2.19,0.95,27.6,199,3175,87.62
47+
39,Y,Yttrium,3,5,2,1.9,,1.8,,,,2.4,,3.345,2.71,1.693,2.12,1.22,22.7,,,88.90584
48+
40,Zr,Zirconium,4,5,3,1.75,,1.55,,,,2.3,,3.124,2.54,1.593,2.06,1.33,17.9,,,91.224
49+
41,Nb,Niobium,5,5,6,1.64,,1.45,,,,2.15,,3.165,2.43,1.589,1.98,,15.7,,,92.90637
50+
42,Mo,Molybdenum,6,5,7,1.54,,1.45,,,,2.1,,3.052,2.39,1.52,1.9,2.16,12.8,,,95.95
51+
43,Tc,Technetium,7,5,6,1.47,,1.35,,,,2.05,,2.998,2.36,1.391,1.83,,11.4,,,
52+
44,Ru,Ruthenium,8,5,5,1.46,,1.3,,,,2.05,,2.963,2.34,1.41,1.78,,9.6,,,101.07
53+
45,Rh,Rhodium,9,5,4,1.42,,1.35,,,,2,,2.929,2.34,1.364,1.73,2.28,8.6,,,102.9055
54+
46,Pd,Palladium,10,5,1,1.39,,1.4,,,,2.05,,2.899,2.37,0.567,1.69,2.2,4.8,,,106.42
55+
47,Ag,Silver,11,5,2,1.45,1.77,1.6,,,,2.1,,3.148,2.43,1.286,1.65,1.93,7.2,,,107.8682
56+
48,Cd,Cadmium,12,5,1,1.44,1.6,1.55,,,,2.2,,2.848,2.5,1.184,1.61,1.69,7.36,,,112.414
57+
49,In,Indium,13,5,2,1.42,,1.55,1.93,,,2.2,4.59,4.463,2.64,1.382,1.56,1.78,10.2,75,779,114.818
58+
50,Sn,Tin,14,5,3,1.39,1.4,1.45,2.17,,,2.25,4.47,4.392,2.59,1.24,1.45,1.96,7.7,60,659,118.71
59+
51,Sb,Antimony,15,5,4,1.39,1.4,1.45,,2.06,,2.2,4.35,4.42,2.52,1.193,1.33,2.05,6.6,44,492,121.76
60+
52,Te,Tellurium,16,5,3,1.38,1.33,1.4,2.06,,,2.1,4.23,4.47,2.44,1.111,1.23,,5.5,40,445,127.6
61+
53,I,Iodine,17,5,2,1.39,1.4,1.4,1.98,,,2.1,4.15,4.5,2.36,1.044,1.15,2.66,5.35,35,385,126.90447
62+
54,Xe,Xenon,18,5,1,1.4,,,2.16,,,,,4.404,2.28,0.986,1.08,,4.044,,,131.293
63+
55,Cs,Caesium,1,6,2,2.44,2.37,2.6,,3.43,,3,,4.517,3.44,2.518,2.98,0.79,59.42,,,132.90545196
64+
56,Ba,Barium,2,6,1,2.15,2.1,2.15,,2.68,,2.7,,3.703,3.07,2.06,2.53,0.89,39.7,,,137.327
65+
57,La,Lanthanum,,6,2,2.07,,1.95,,,,2.5,,3.522,2.78,1.915,,1.1,31.1,,,138.90547
66+
58,Ce,Cerium,,6,1,2.04,,1.85,,,,,,3.556,2.74,1.978,,,29.6,,,140.116
67+
59,Pr,Praseodymium,,6,4,2.03,,1.85,,,,,,3.606,2.73,1.942,2.47,1.13,28.2,,,140.90766
68+
60,Nd,Neodymium,,6,5,2.01,,1.85,,,,,,3.575,2.73,1.912,2.06,1.14,31.4,,,144.242
69+
61,Pm,Promethium,,6,6,1.99,,1.85,,,,,,3.547,2.72,1.882,2.05,,30.1,,,
70+
62,Sm,Samarium,,6,7,1.98,,1.85,,,,,,3.52,2.71,1.854,2.38,1.17,28.8,,,150.36
71+
63,Eu,Europium,,6,8,1.98,,1.85,,,,,,3.493,2.94,1.826,2.31,,27.7,,,151.964
72+
64,Gd,Gadolinium,,6,9,1.96,,1.8,,,,,,3.368,2.71,1.713,2.33,1.2,23.5,,,157.25
73+
65,Tb,Terbium,,6,6,1.94,,1.75,,,,,,3.451,2.7,1.775,2.25,,25.5,,,158.92535
74+
66,Dy,Dysprosium,,6,5,1.92,,1.75,,,,,,3.428,2.9,1.75,2.28,1.22,24.5,,,162.5
75+
67,Ho,Holmium,,6,4,1.92,,1.75,,,,,,3.409,2.67,1.727,2.26,1.23,23.6,,,164.93033
76+
68,Er,Erbium,,6,3,1.89,,1.75,,,,,,3.391,2.67,1.703,2.26,1.24,22.7,,,167.259
77+
69,Tm,Thulium,,6,2,1.9,,1.75,,,,,,3.374,2.67,1.681,2.22,1.25,21.8,,,168.93422
78+
70,Yb,Ytterbium,,6,1,1.87,,1.75,,,,,,3.355,2.79,1.658,2.22,,21,,,173.054
79+
71,Lu,Lutetium,3,6,2,1.87,,1.75,,,,,,3.64,2.65,1.553,2.17,1.27,21.9,,,174.9668
80+
72,Hf,Hafnium,4,6,3,1.75,,1.55,,,,2.25,,3.141,2.53,1.476,2.08,,16.2,,,178.49
81+
73,Ta,Tantalum,5,6,4,1.7,,1.45,,,,2.2,,3.17,2.43,1.413,2,,13.1,,,180.94788
82+
74,W,Tungsten,6,6,5,1.62,,1.35,,,,2.1,,3.096,2.39,1.36,1.93,2.36,11.1,,,183.84
83+
75,Re,Rhenium,7,6,6,1.51,,1.35,,,,2.05,,2.954,2.37,1.31,1.88,,9.7,,,186.207
84+
76,Os,Osmium,8,6,5,1.44,,1.3,,,,2,,3.12,2.35,1.266,1.85,,8.5,,,190.23
85+
77,Ir,Iridium,9,6,4,1.41,,1.35,,,,2,,2.84,2.36,1.227,1.8,2.2,7.6,,,192.217
86+
78,Pt,Platinum,10,6,3,1.36,,1.35,,,,2.05,,2.754,2.39,1.221,1.77,2.28,6.5,,,195.084
87+
79,Au,Gold,11,6,2,1.36,,1.35,,,,2.1,,3.293,2.43,1.187,1.74,2.54,5.8,,,196.966569
88+
80,Hg,Mercury,12,6,1,1.32,,1.5,,,,2.05,,2.705,2.53,1.126,1.71,2,5.02,,,200.592
89+
81,Tl,Thallium,13,6,2,1.45,1.9,1.9,1.96,,,2.2,,4.347,2.59,1.319,1.56,2.04,7.6,,,204.3835
90+
82,Pb,Lead,14,6,3,1.46,,,2.02,,,2.3,,4.297,2.74,1.215,1.54,2.33,6.8,,,207.2
91+
83,Bi,Bismuth,15,6,4,1.48,1.48,1.6,,2.07,,2.3,,4.37,2.66,1.295,1.43,2.02,7.4,,,208.9804
92+
84,Po,Polonium,16,6,3,1.4,,1.9,,1.97,,,,4.709,2.59,1.212,1.35,,6.8,,,
93+
85,At,Astatine,17,6,2,1.5,,,,2.02,,,,4.75,2.51,1.146,1.27,,6,,,
94+
86,Rn,Radon,18,6,1,1.5,,,,2.2,,,,4.765,2.43,1.09,1.2,,5.3,,,
95+
87,Fr,Francium,1,7,2,2.6,,,,3.48,,,,4.9,3.64,2.447,,,47.1,,,
96+
88,Ra,Radium,2,7,1,2.21,,2.15,,2.83,,,,3.677,3.27,2.042,,,38.3,,,
97+
89,Ac,Actinium,,7,2,2.15,,1.95,,,,,,3.478,3.08,1.895,,,32.1,,,
98+
90,Th,Thorium,,7,3,2.06,,1.8,,,,2.4,,3.396,2.74,1.788,,,32.1,,,232.0377
99+
91,Pa,Protactinium,,7,4,2,,1.8,,,,,,3.424,2.64,1.804,,,25.4,,,231.03588
100+
92,U,Uranium,,7,5,1.96,,1.75,,,,2.3,,3.395,2.52,1.775,,1.38,24.9,,,238.02891
101+
93,Np,Neptunium,,7,6,1.9,,1.75,,,,,,3.424,2.52,1.741,,1.36,24.8,,,
102+
94,Pu,Plutonium,,7,7,1.87,,1.75,,,,,,3.424,2.52,1.784,,1.28,24.5,,,
103+
95,Am,Americium,,7,8,1.8,,1.75,,,,,,3.381,,1.757,,,23.3,,,
104+
96,Cm,Curium,,7,9,1.69,,,,,,,,3.326,,1.657,,,23,,,
105+
97,Bk,Berkelium,,7,6,,,,,,,,,3.339,,1.626,,,22.7,,,
106+
98,Cf,Californium,,7,5,,,,,,,,,3.313,,1.598,,,20.5,,,
107+
99,Es,Einsteinium,,7,4,,,,,,,,,3.299,,1.576,,,19.7,,,
108+
100,Fm,Fermium,,7,3,,,,,,,,,3.286,,1.557,,,23.8,,,
109+
101,Md,Mendelevium,,7,2,,,,,,,,,3.274,,1.527,,,18.2,,,
110+
102,No,Nobelium,,7,1,,,,,,,,,3.248,,1.581,,,17.5,,,
111+
103,Lr,Lawrencium,3,7,2,,,,,,,,,3.236,,,,,,,,
112+
104,Rf,Rutherfordium,4,7,3,,,,,,,,,,,,,,,,,
113+
105,Db,Dubnium,5,7,4,,,,,,,,,,,,,,,,,
114+
106,Sg,Seaborgium,6,7,5,,,,,,,,,,,,,,,,,
115+
107,Bh,Bohrium,7,7,6,,,,,,,,,,,,,,,,,
116+
108,Hs,Hassium,8,7,5,,,,,,,,,,,,,,,,,
117+
109,Mt,Meitnerium,9,7,4,,,,,,,,,,,,,,,,,
118+
110,Ds,Darmstadtium,10,7,3,,,,,,,,,,,,,,,,,
119+
111,Rg,Roentgenium,11,7,2,,,,,,,,,,,,,,,,,
120+
112,Cn,Copernicium,12,7,1,,,,,,,,,,,,,,,,,
121+
113,Uut,Ununtrium,13,7,2,,,,,,,,,,,,,,,,,
122+
114,Fl,Flerovium,14,7,3,,,,,,,,,,,,,,,,,
123+
115,Uup,Ununpentium,15,7,4,,,,,,,,,,,,,,,,,
124+
116,Lv,Livermorium,16,7,3,,,,,,,,,,,,,,,,,
125+
117,Uus,Ununseptium,17,7,2,,,,,,,,,,,,,,,,,

atomdb/test/test_periodic.py

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
import pytest
2+
import numpy as np
3+
from atomdb.periodic import num2sym, sym2num, name2num, num2name, Atom
4+
5+
6+
def test_num2sym():
7+
assert num2sym[1] == "H"
8+
assert num2sym[6] == "C"
9+
assert num2sym[26] == "Fe"
10+
11+
12+
def test_sym2num():
13+
assert sym2num["H"] == 1
14+
assert sym2num["C"] == 6
15+
assert sym2num["Fe"] == 26
16+
17+
18+
def name2num():
19+
assert sym2num["hydrogen"] == 1
20+
assert sym2num["carbon"] == 6
21+
assert sym2num["iron"] == 26
22+
23+
assert sym2num["Hydrogen"] == 1
24+
assert sym2num["Carbon"] == 6
25+
assert sym2num["Iron"] == 26
26+
27+
28+
def num2name():
29+
assert sym2num[1] == "Hydrogen"
30+
assert sym2num[6] == "Carbon"
31+
assert sym2num[26] == "Iron"
32+
33+
34+
def test_atom_invalid_element():
35+
with pytest.raises(Exception):
36+
Atom("InvalidElement")
37+
38+
39+
def test_atom_invalid_symbol():
40+
with pytest.raises(Exception):
41+
Atom("AA")
42+
43+
44+
def test_atom_invalid_atnum():
45+
with pytest.raises(Exception):
46+
Atom(-2)
47+
48+
49+
def test_atom_invalid_charge():
50+
with pytest.raises(Exception):
51+
Atom(1, charge=2)
52+
with pytest.raises(Exception):
53+
Atom(1, charge=1.5)
54+
with pytest.raises(Exception):
55+
Atom(112, charge=-10)
56+
57+
58+
def test_get_attributes():
59+
# will test getting the attributes of the atom for Hydrogen and Carbon
60+
61+
atom = Atom(1)
62+
assert atom.atnum == 1
63+
assert atom.atsym == "H"
64+
assert atom.atname == "Hydrogen"
65+
assert atom.charge == 0
66+
67+
h_data = {
68+
"atnum": 1,
69+
"atsym": "H",
70+
"atname": "Hydrogen",
71+
"charge": 0,
72+
"group": 1,
73+
"period": 1,
74+
"multiplicity": 2,
75+
"cov_radius": {"cordero": 0.31, "bragg": np.nan, "slater": 0.25},
76+
"vdw_radius": {
77+
"bondi": 1.2,
78+
"truhlar": np.nan,
79+
"rt": 1.1,
80+
"batsanov": np.nan,
81+
"dreiding": 3.195,
82+
"uff": 2.886,
83+
"mm3": 1.62,
84+
},
85+
"at_radius": {"wc": 0.529192875, "cr": 0.53},
86+
"eneg": {"pauling": 2.2},
87+
"pold": {"crc": 0.666793, "chu": 4.5},
88+
"c6": {"chu": 6.499026705},
89+
"mass": {"stb": 1.007975},
90+
}
91+
for i in h_data:
92+
assert getattr(atom, i) == h_data[i]
93+
94+
atom = Atom(6)
95+
c_data = {
96+
"atnum": 6,
97+
"atsym": "C",
98+
"atname": "Carbon",
99+
"charge": 0,
100+
"group": 14,
101+
"period": 2,
102+
"multiplicity": 3,
103+
"cov_radius": {"cordero": 0.7445337366, "bragg": 0.77, "slater": 0.7},
104+
"vdw_radius": {
105+
"bondi": 1.7,
106+
"truhlar": np.nan,
107+
"rt": 1.77,
108+
"batsanov": 1.7,
109+
"dreiding": 3.8983,
110+
"uff": 3.851,
111+
"mm3": 2.04,
112+
},
113+
"at_radius": {"wc": 0.62, "cr": 0.67},
114+
"eneg": {"pauling": 2.55},
115+
"pold": {"crc": 1.76, "chu": 12.0},
116+
"c6": {"chu": 46.6},
117+
"mass": {"stb": 12.0106},
118+
}
119+
120+
for i in c_data:
121+
assert getattr(atom, i) == c_data[i]

0 commit comments

Comments
 (0)