pymatgen.util.testing module

Common test support for pymatgen test scripts.

This single module should provide all the common functionality for pymatgen tests in a single location, so that test scripts can just import it and work right away.

class PymatgenTest(methodName='runTest')[source]

Bases: unittest.case.TestCase

Extends unittest.TestCase with functions (taken from numpy.testing.utils) that support the comparison of arrays.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

MODULE_DIR = PosixPath('/Users/shyue/repos/pymatgen/docs_rst/../pymatgen/util')[source]
STRUCTURES_DIR = PosixPath('/Users/shyue/repos/pymatgen/docs_rst/../pymatgen/util/structures')[source]
TEST_FILES_DIR = PosixPath('/Users/shyue/repos/pymatgen/docs_rst/../pymatgen/util/../../test_files')[source]
TEST_STRUCTURES = {'BaNiO3': <pymatgen.alchemy.materials.TransformedStructure object>, 'CsCl': Structure Summary Lattice     abc : 4.209 4.209 4.209  angles : 90.0 90.0 90.0  volume : 74.56530132899998       A : 4.209 0.0 0.0       B : 0.0 4.209 0.0       C : 0.0 0.0 4.209 PeriodicSite: Cs (0.0000, 0.0000, 0.0000) [0.0000, 0.0000, 0.0000] PeriodicSite: Cl (2.1045, 2.1045, 2.1045) [0.5000, 0.5000, 0.5000], 'Graphite': Structure Summary Lattice     abc : 2.4700000000000006 2.47 6.8  angles : 90.0 90.0 120.00000000000001  volume : 35.928033824449685       A : -1.2350000000000005 -2.139082747347564 -3.024877593893963e-16       B : -1.2349999999999997 2.139082747347564 1.5124387969469814e-16       C : 0.0 0.0 -6.8 PeriodicSite: C0+ (-1.2350, -0.7132, -5.1000) [0.6667, 0.3333, 0.7500] PeriodicSite: C0+ (-1.2350, 0.7132, -1.7000) [0.3333, 0.6667, 0.2500] PeriodicSite: C0+ (0.0000, 0.0000, -5.1000) [0.0000, 0.0000, 0.7500] PeriodicSite: C0+ (0.0000, 0.0000, -1.7000) [0.0000, 0.0000, 0.2500], 'He_BCC': Structure Summary Lattice     abc : 2.737172073807164 2.7371720737557492 2.73717207  angles : 109.47122060669534 109.47122060631484 109.47122066304705  volume : 15.786447515629305       A : 2.58063058 0.0 -0.91239069       B : -1.29031529 2.23489164 -0.91239069       C : 0.0 0.0 2.73717207 PeriodicSite: He (0.0000, 0.0000, 0.0000) [0.0000, 0.0000, 0.0000], 'K2O2': Structure Summary Lattice     abc : 4.862375062662279 4.862375062662278 6.361  angles : 90.0 90.0 91.89149308502677  volume : 150.30921504900002       A : 3.3810000000000002 -3.4945000000000004 0.0       B : 3.381 3.4944999999999995 4.2795282396204257e-16       C : 0.0 0.0 -6.361 PeriodicSite: K+ (1.6905, -1.0861, -1.5902) [0.4054, 0.0946, 0.2500] PeriodicSite: K+ (1.6905, 1.0861, -4.7707) [0.0946, 0.4054, 0.7500] PeriodicSite: K+ (5.0715, 1.0861, -4.7707) [0.5946, 0.9054, 0.7500] PeriodicSite: K+ (5.0715, -1.0861, -1.5902) [0.9054, 0.5946, 0.2500] PeriodicSite: O- (3.3810, -0.6262, -3.6417) [0.5896, 0.4104, 0.5725] PeriodicSite: O- (3.3810, 0.6262, -2.7193) [0.4104, 0.5896, 0.4275] PeriodicSite: O- (3.3810, -2.8683, -0.4612) [0.9104, 0.0896, 0.0725] PeriodicSite: O- (3.3810, 2.8683, -5.8998) [0.0896, 0.9104, 0.9275], 'La2CoO4F': Structure Summary Lattice     abc : 6.847249 6.847249 5.748369  angles : 90.0 90.0 132.754623  volume : 197.89340779864318       A : 6.847249 0.0 4.192730785407457e-16       B : -4.648323410186749 5.027714027499061 4.192730785407457e-16       C : 0.0 0.0 5.748369 PeriodicSite: La3+ (-3.0614, 4.3336, 2.7708) [0.1380, 0.8620, 0.4820] PeriodicSite: La3+ (5.2603, 0.6941, 2.9775) [0.8620, 0.1380, 0.5180] PeriodicSite: La3+ (-0.4875, 3.2079, 5.6450) [0.3620, 0.6380, 0.9820] PeriodicSite: La3+ (2.6864, 1.8198, 0.1033) [0.6380, 0.3620, 0.0180] PeriodicSite: Co3+ (1.0995, 2.5139, 2.8742) [0.5000, 0.5000, 0.5000] PeriodicSite: Co3+ (0.0000, 0.0000, 0.0000) [0.0000, 0.0000, 0.0000] PeriodicSite: O2- (-0.9933, 3.4292, 3.2966) [0.3180, 0.6821, 0.5735] PeriodicSite: O2- (3.1922, 1.5986, 2.4518) [0.6821, 0.3180, 0.4265] PeriodicSite: O2- (-2.5555, 4.1124, 0.4224) [0.1820, 0.8179, 0.0735] PeriodicSite: O2- (4.7545, 0.9153, 5.3260) [0.8179, 0.1820, 0.9265] PeriodicSite: O2- (1.4256, 3.8686, 1.4371) [0.7305, 0.7695, 0.2500] PeriodicSite: O2- (1.8728, 3.6730, 4.3113) [0.7695, 0.7305, 0.7500] PeriodicSite: O2- (0.3261, 1.3547, 1.4371) [0.2305, 0.2695, 0.2500] PeriodicSite: O2- (0.7734, 1.1591, 4.3113) [0.2695, 0.2305, 0.7500] PeriodicSite: F- (-2.3242, 2.5139, 4.3113) [0.0000, 0.5000, 0.7500] PeriodicSite: F2- (3.4236, 0.0000, 1.4371) [0.5000, 0.0000, 0.2500], 'Li10GeP2S12': Structure Summary Lattice     abc : 8.69407 8.69407 12.5994  angles : 90.0 90.0 90.0  volume : 952.3489977658411       A : -8.69407 0.0 -5.323582498531514e-16       B : 5.323582498531514e-16 -8.69407 -5.323582498531514e-16       C : 0.0 0.0 -12.5994 PeriodicSite: Li:0.691 (-6.4658, -6.3310, -10.2912) [0.7437, 0.7282, 0.8168] PeriodicSite: Li:0.691 (-2.2283, -2.3630, -10.2912) [0.2563, 0.2718, 0.8168] PeriodicSite: Li:0.691 (-6.7101, -2.1187, -3.9915) [0.7718, 0.2437, 0.3168] PeriodicSite: Li:0.691 (-1.9840, -6.5753, -3.9915) [0.2282, 0.7563, 0.3168] PeriodicSite: Li:0.691 (-6.5753, -1.9840, -8.6079) [0.7563, 0.2282, 0.6832] PeriodicSite: Li:0.691 (-2.1187, -6.7101, -8.6079) [0.2437, 0.7718, 0.6832] PeriodicSite: Li:0.691 (-6.3310, -6.4658, -2.3082) [0.7282, 0.7437, 0.1832] PeriodicSite: Li:0.691 (-2.3630, -2.2283, -2.3082) [0.2718, 0.2563, 0.1832] PeriodicSite: Li:0.691 (-6.5753, -6.7101, -8.6079) [0.7563, 0.7718, 0.6832] PeriodicSite: Li:0.691 (-2.1187, -1.9840, -8.6079) [0.2437, 0.2282, 0.6832] PeriodicSite: Li:0.691 (-6.3310, -2.2283, -2.3082) [0.7282, 0.2563, 0.1832] PeriodicSite: Li:0.691 (-2.3630, -6.4658, -2.3082) [0.2718, 0.7437, 0.1832] PeriodicSite: Li:0.691 (-6.4658, -2.3630, -10.2912) [0.7437, 0.2718, 0.8168] PeriodicSite: Li:0.691 (-2.2283, -6.3310, -10.2912) [0.2563, 0.7282, 0.8168] PeriodicSite: Li:0.691 (-6.7101, -6.5753, -3.9915) [0.7718, 0.7563, 0.3168] PeriodicSite: Li:0.691 (-1.9840, -2.1187, -3.9915) [0.2282, 0.2437, 0.3168] PeriodicSite: Li (0.0000, -4.3470, -0.6980) [0.0000, 0.5000, 0.0554] PeriodicSite: Li (0.0000, -4.3470, -6.9977) [0.0000, 0.5000, 0.5554] PeriodicSite: Li (-4.3470, 0.0000, -5.6017) [0.5000, 0.0000, 0.4446] PeriodicSite: Li (-4.3470, 0.0000, -11.9014) [0.5000, 0.0000, 0.9446] PeriodicSite: Li:0.643 (-6.5527, -6.5527, -0.0000) [0.7537, 0.7537, 0.0000] PeriodicSite: Li:0.643 (-2.1413, -2.1413, -0.0000) [0.2463, 0.2463, 0.0000] PeriodicSite: Li:0.643 (-6.4884, -2.2057, -6.2997) [0.7463, 0.2537, 0.5000] PeriodicSite: Li:0.643 (-2.2057, -6.4884, -6.2997) [0.2537, 0.7463, 0.5000] PeriodicSite: Li:0.643 (-6.4884, -6.4884, -6.2997) [0.7463, 0.7463, 0.5000] PeriodicSite: Li:0.643 (-2.2057, -2.2057, -6.2997) [0.2537, 0.2537, 0.5000] PeriodicSite: Li:0.643 (-6.5527, -2.1413, -0.0000) [0.7537, 0.2463, 0.0000] PeriodicSite: Li:0.643 (-2.1413, -6.5527, -0.0000) [0.2463, 0.7537, 0.0000] PeriodicSite: Ge:0.515, P:0.485 (0.0000, -4.3470, -3.8970) [0.0000, 0.5000, 0.3093] PeriodicSite: Ge:0.515, P:0.485 (0.0000, -4.3470, -10.1967) [0.0000, 0.5000, 0.8093] PeriodicSite: Ge:0.515, P:0.485 (-4.3470, 0.0000, -2.4027) [0.5000, 0.0000, 0.1907] PeriodicSite: Ge:0.515, P:0.485 (-4.3470, 0.0000, -8.7024) [0.5000, 0.0000, 0.6907] PeriodicSite: P (0.0000, 0.0000, -6.2997) [0.0000, 0.0000, 0.5000] PeriodicSite: P (-4.3470, -4.3470, -0.0000) [0.5000, 0.5000, 0.0000] PeriodicSite: S (-8.6941, -7.0918, -7.4299) [1.0000, 0.8157, 0.5897] PeriodicSite: S (0.0000, -1.6023, -7.4299) [0.0000, 0.1843, 0.5897] PeriodicSite: S (-5.9494, -4.3470, -1.1302) [0.6843, 0.5000, 0.0897] PeriodicSite: S (-2.7447, -4.3470, -1.1302) [0.3157, 0.5000, 0.0897] PeriodicSite: S (-4.3470, -2.7447, -11.4692) [0.5000, 0.3157, 0.9103] PeriodicSite: S (-4.3470, -5.9494, -11.4692) [0.5000, 0.6843, 0.9103] PeriodicSite: S (-7.0918, 0.0000, -5.1695) [0.8157, 0.0000, 0.4103] PeriodicSite: S (-1.6023, 0.0000, -5.1695) [0.1843, 0.0000, 0.4103] PeriodicSite: S (-8.6941, -6.0937, -11.4025) [1.0000, 0.7009, 0.9050] PeriodicSite: S (0.0000, -2.6004, -11.4025) [0.0000, 0.2991, 0.9050] PeriodicSite: S (-6.9474, -4.3470, -5.1028) [0.7991, 0.5000, 0.4050] PeriodicSite: S (-1.7466, -4.3470, -5.1028) [0.2009, 0.5000, 0.4050] PeriodicSite: S (-4.3470, -1.7466, -7.4966) [0.5000, 0.2009, 0.5950] PeriodicSite: S (-4.3470, -6.9474, -7.4966) [0.5000, 0.7991, 0.5950] PeriodicSite: S (-6.0937, 0.0000, -1.1969) [0.7009, 0.0000, 0.0950] PeriodicSite: S (-2.6004, 0.0000, -1.1969) [0.2991, 0.0000, 0.0950] PeriodicSite: S (0.0000, -2.6169, -2.6282) [0.0000, 0.3010, 0.2086] PeriodicSite: S (-8.6941, -6.0772, -2.6282) [1.0000, 0.6990, 0.2086] PeriodicSite: S (-1.7301, -4.3470, -8.9279) [0.1990, 0.5000, 0.7086] PeriodicSite: S (-6.9640, -4.3470, -8.9279) [0.8010, 0.5000, 0.7086] PeriodicSite: S (-4.3470, -6.9640, -3.6715) [0.5000, 0.8010, 0.2914] PeriodicSite: S (-4.3470, -1.7301, -3.6715) [0.5000, 0.1990, 0.2914] PeriodicSite: S (-2.6169, 0.0000, -9.9712) [0.3010, 0.0000, 0.7914] PeriodicSite: S (-6.0772, 0.0000, -9.9712) [0.6990, 0.0000, 0.7914], 'Li2O': Structure Summary Lattice     abc : 3.291071792359756 3.291071899625086 3.2910720568557887  angles : 60.12971043288485 60.12970952137675 60.12970313039097  volume : 25.279668381289053       A : 2.91738857 0.09789437 1.52000466       B : 0.96463406 2.75503561 1.52000466       C : 0.13320635 0.09789443 3.28691771 PeriodicSite: O2- (0.0000, 0.0000, 0.0000) [0.0000, 0.0000, 0.0000] PeriodicSite: Li+ (3.0121, 2.2136, 4.7463) [0.7502, 0.7502, 0.7502] PeriodicSite: Li+ (1.0031, 0.7372, 1.5806) [0.2498, 0.2498, 0.2498], 'Li2O2': Structure Summary Lattice     abc : 3.1830000000000007 3.1830000000000003 7.7258  angles : 90.0 90.0 120.00000000000001  volume : 67.7871492344378       A : -1.5915000000000006 -2.756558860245869 -3.898050761686025e-16       B : -1.5914999999999992 2.756558860245869 1.9490253808430124e-16       C : 0.0 0.0 -7.7258 PeriodicSite: Li+ (0.0000, 0.0000, -3.8629) [0.0000, 0.0000, 0.5000] PeriodicSite: Li+ (0.0000, 0.0000, 0.0000) [0.0000, 0.0000, 0.0000] PeriodicSite: Li+ (-1.5915, -0.9190, -5.7943) [0.6667, 0.3333, 0.7500] PeriodicSite: Li+ (-1.5915, 0.9190, -1.9314) [0.3333, 0.6667, 0.2500] PeriodicSite: O- (-1.5915, -0.9190, -1.1566) [0.6667, 0.3333, 0.1497] PeriodicSite: O- (-1.5915, 0.9190, -6.5692) [0.3333, 0.6667, 0.8503] PeriodicSite: O- (-1.5915, 0.9190, -5.0195) [0.3333, 0.6667, 0.6497] PeriodicSite: O- (-1.5915, -0.9190, -2.7063) [0.6667, 0.3333, 0.3503], 'Li3V2(PO4)3': Structure Summary Lattice     abc : 8.64068 8.67265 8.64068  angles : 61.21317 61.3442 61.21317  volume : 470.7978186322687       A : -2.470939478415996 -7.168424451387926 -4.143609518420984       B : -7.600861301025969 0.0 -4.17633397910965       C : 0.0 0.0 -8.64068 PeriodicSite: Li0+ (-9.8221, -7.1201, -8.1771) [0.9933, 0.9693, 0.0015] PeriodicSite: Li0+ (-5.2652, -3.5733, -8.6603) [0.4985, 0.5307, 0.5067] PeriodicSite: Li0+ (-6.0857, -1.1171, -6.7518) [0.1558, 0.7500, 0.3442] PeriodicSite: Li0+ (-3.9986, -6.0875, -10.1861) [0.8492, 0.2500, 0.6508] PeriodicSite: Li0+ (-4.4741, -5.3421, -5.9052) [0.7452, 0.3464, 0.1586] PeriodicSite: Li0+ (-2.0112, -2.4471, -8.5778) [0.3414, 0.1536, 0.7548] PeriodicSite: V0+ (-8.6165, -6.1274, -14.5645) [0.8548, 0.8558, 0.8621] PeriodicSite: V0+ (-6.4732, -4.5730, -10.9092) [0.6379, 0.6442, 0.6452] PeriodicSite: V0+ (-3.5744, -2.5407, -5.9951) [0.3544, 0.3550, 0.3522] PeriodicSite: V0+ (-1.4669, -1.0591, -2.4754) [0.1478, 0.1450, 0.1456] PeriodicSite: P0+ (-7.8497, -1.7789, -9.7592) [0.2482, 0.9521, 0.5503] PeriodicSite: P0+ (-6.5114, -6.8080, -8.3997) [0.9497, 0.5479, 0.2518] PeriodicSite: P0+ (-6.8308, -3.2786, -5.3958) [0.4574, 0.7500, 0.0426] PeriodicSite: P0+ (-3.2537, -3.9267, -11.5417) [0.5478, 0.2500, 0.9522] PeriodicSite: P0+ (-3.5598, -0.2774, -8.5391) [0.0387, 0.4558, 0.7494] PeriodicSite: P0+ (-2.1909, -5.3806, -7.2809) [0.7506, 0.0442, 0.4613] PeriodicSite: O0+ (-8.3983, -5.1136, -10.9141) [0.7133, 0.8730, 0.4991] PeriodicSite: O0+ (-6.5103, -3.5115, -12.5689) [0.4899, 0.6973, 0.8827] PeriodicSite: O0+ (-7.4256, -0.5548, -10.6251) [0.0774, 0.9518, 0.7325] PeriodicSite: O0+ (-7.9453, -1.4000, -8.2592) [0.1953, 0.9818, 0.3876] PeriodicSite: O0+ (-6.7928, -2.9117, -9.8164) [0.4062, 0.7617, 0.5732] PeriodicSite: O0+ (-5.7536, -6.2988, -11.6913) [0.8787, 0.4713, 0.7039] PeriodicSite: O0+ (-7.9023, -6.6440, -7.7347) [0.9268, 0.7384, 0.0938] PeriodicSite: O0+ (-6.0633, -5.5016, -9.1213) [0.7675, 0.5482, 0.4226] PeriodicSite: O0+ (-7.6267, -4.4251, -5.9980) [0.6173, 0.8027, 0.0101] PeriodicSite: O0+ (-7.5702, -1.8930, -5.4665) [0.2641, 0.9101, 0.0661] PeriodicSite: O0+ (-4.4855, -4.0749, -10.6051) [0.5685, 0.4053, 0.7588] PeriodicSite: O0+ (-4.7679, -0.0067, -9.4196) [0.0009, 0.6270, 0.7867] PeriodicSite: O0+ (-5.3896, -7.0627, -7.3776) [0.9852, 0.3888, 0.1934] PeriodicSite: O0+ (-5.5557, -3.1102, -6.2999) [0.4339, 0.5899, 0.2359] PeriodicSite: O0+ (-2.5509, -5.3129, -11.5157) [0.7412, 0.0947, 0.9316] PeriodicSite: O0+ (-2.3963, -2.7970, -10.9316) [0.3902, 0.1884, 0.9869] PeriodicSite: O0+ (-3.8311, -1.6586, -7.8407) [0.2314, 0.4288, 0.5892] PeriodicSite: O0+ (-2.2016, -0.4825, -9.2908) [0.0673, 0.2678, 0.9135] PeriodicSite: O0+ (-3.2143, -4.2040, -7.1387) [0.5865, 0.2322, 0.4327] PeriodicSite: O0+ (-4.2162, -0.8054, -5.2624) [0.1124, 0.5182, 0.3047] PeriodicSite: O0+ (-2.1852, -5.7069, -8.7871) [0.7961, 0.0287, 0.6213] PeriodicSite: O0+ (-2.7916, -6.5290, -6.3923) [0.9108, 0.0712, 0.2686] PeriodicSite: O0+ (-3.6360, -3.6778, -4.3760) [0.5131, 0.3116, 0.1098] PeriodicSite: O0+ (-1.6028, -2.1976, -6.1825) [0.3066, 0.1112, 0.5148], 'LiFePO4': Structure Summary Lattice     abc : 4.7448 6.0657700000000006 10.41037  angles : 90.50178999999999 90.00019 90.00362  volume : 299.60796771125047       A : 0.0 0.0 -4.7448       B : -0.053122654367700306 -6.065537365280947 0.00038324092231544317       C : 10.41036999994276 0.0 3.452209424235223e-05 PeriodicSite: Li (10.3571, -6.0655, 0.0004) [0.0000, 1.0000, 1.0000] PeriodicSite: Li (-0.0265, -3.0328, -4.7446) [1.0000, 0.5000, 0.0000] PeriodicSite: Li (5.1521, -6.0655, -2.3720) [0.5000, 1.0000, 0.5000] PeriodicSite: Li (5.1786, -3.0328, -2.3723) [0.5000, 0.5000, 0.5000] PeriodicSite: Fe (2.2647, -1.5372, -2.4912) [0.5251, 0.2534, 0.2188] PeriodicSite: Fe (2.8873, -4.5282, -0.1187) [0.0251, 0.7465, 0.2812] PeriodicSite: Fe (7.4699, -1.5374, -4.6259) [0.9750, 0.2535, 0.7188] PeriodicSite: Fe (8.0925, -4.5281, -2.2531) [0.4749, 0.7465, 0.7812] PeriodicSite: P (0.9432, -4.5594, -2.7614) [0.5821, 0.7517, 0.0944] PeriodicSite: P (4.2088, -1.5061, -0.3893) [0.0821, 0.2483, 0.4056] PeriodicSite: P (6.1483, -4.5597, -4.3551) [0.9179, 0.7517, 0.5944] PeriodicSite: P (9.4141, -1.5060, -1.9829) [0.4179, 0.2483, 0.9056] PeriodicSite: O (0.4361, -1.5232, -1.3833) [0.2916, 0.2511, 0.0432] PeriodicSite: O (0.9618, -4.5518, -1.2263) [0.2585, 0.7504, 0.0962] PeriodicSite: O (1.6753, -5.7983, -3.3849) [0.7135, 0.9559, 0.1658] PeriodicSite: O (1.6950, -3.3276, -3.3983) [0.7163, 0.5486, 0.1656] PeriodicSite: O (3.4570, -2.7380, -1.0261) [0.2163, 0.4514, 0.3344] PeriodicSite: O (3.4767, -0.2672, -1.0127) [0.2135, 0.0441, 0.3342] PeriodicSite: O (4.1902, -1.5137, -3.5989) [0.7585, 0.2495, 0.4038] PeriodicSite: O (4.7159, -4.5425, -3.7555) [0.7916, 0.7489, 0.4568] PeriodicSite: O (5.6412, -1.5231, -0.9889) [0.2084, 0.2511, 0.5432] PeriodicSite: O (6.1670, -4.5519, -1.1455) [0.2415, 0.7505, 0.5962] PeriodicSite: O (6.8801, -5.7988, -3.7318) [0.7866, 0.9560, 0.6658] PeriodicSite: O (6.9004, -3.3280, -3.7181) [0.7837, 0.5487, 0.6656] PeriodicSite: O (8.6620, -2.7376, -1.3457) [0.2837, 0.4513, 0.8344] PeriodicSite: O (8.6823, -0.2668, -1.3597) [0.2866, 0.0440, 0.8342] PeriodicSite: O (9.3954, -1.5138, -3.5181) [0.7415, 0.2496, 0.9038] PeriodicSite: O (9.9213, -4.5424, -3.3610) [0.7084, 0.7489, 0.9568], 'NaFePO4': Structure Summary Lattice     abc : 4.9955 6.28746 10.440590000000002  angles : 90.0 89.97269 90.0  volume : 327.9285211911844       A : 0.0 0.0 -4.9955       B : 3.849958881883509e-16 -6.28746 -3.849958881883509e-16       C : -10.440588813976833 0.0 -0.004976500966151329 PeriodicSite: Na (-10.4402, -6.2870, -5.0004) [1.0000, 0.9999, 1.0000] PeriodicSite: Na (-10.4402, -3.1442, -5.0004) [1.0000, 0.5001, 1.0000] PeriodicSite: Na (-5.2197, -6.2870, -2.5005) [0.5001, 0.9999, 0.4999] PeriodicSite: Na (-5.2197, -3.1442, -2.5005) [0.5001, 0.5001, 0.4999] PeriodicSite: Fe (-8.2056, -1.5719, -2.6193) [0.5235, 0.2500, 0.7859] PeriodicSite: Fe (-7.4584, -4.7156, -0.1238) [0.0241, 0.7500, 0.7144] PeriodicSite: Fe (-2.9844, -1.5719, -4.8792) [0.9764, 0.2500, 0.2859] PeriodicSite: Fe (-2.2367, -4.7156, -2.3805) [0.4763, 0.7500, 0.2142] PeriodicSite: P (-9.3366, -4.7156, -2.8377) [0.5672, 0.7500, 0.8943] PeriodicSite: P (-6.3250, -1.5719, -0.3370) [0.0669, 0.2500, 0.6058] PeriodicSite: P (-4.1164, -4.7156, -4.6625) [0.9329, 0.7500, 0.3943] PeriodicSite: P (-1.1040, -1.5719, -2.1641) [0.4331, 0.2500, 0.1057] PeriodicSite: O (-10.0753, -1.5719, -1.6636) [0.3321, 0.2500, 0.9650] PeriodicSite: O (-9.2800, -4.7156, -1.2986) [0.2591, 0.7500, 0.8888] PeriodicSite: O (-8.6132, -5.9528, -3.4881) [0.6974, 0.9468, 0.8250] PeriodicSite: O (-8.6132, -3.4783, -3.4881) [0.6974, 0.5532, 0.8250] PeriodicSite: O (-7.0467, -2.8104, -0.9879) [0.1971, 0.4470, 0.6749] PeriodicSite: O (-7.0467, -0.3333, -0.9879) [0.1971, 0.0530, 0.6749] PeriodicSite: O (-6.3830, -1.5719, -3.7937) [0.7588, 0.2500, 0.6114] PeriodicSite: O (-5.5841, -4.7156, -4.1557) [0.8314, 0.7500, 0.5348] PeriodicSite: O (-4.8549, -1.5719, -0.8420) [0.1681, 0.2500, 0.4650] PeriodicSite: O (-4.0586, -4.7156, -1.2059) [0.2410, 0.7500, 0.3887] PeriodicSite: O (-3.3933, -5.9537, -4.0111) [0.8026, 0.9469, 0.3250] PeriodicSite: O (-3.3933, -3.4775, -4.0111) [0.8026, 0.5531, 0.3250] PeriodicSite: O (-1.8263, -2.8099, -1.5129) [0.3027, 0.4469, 0.1749] PeriodicSite: O (-1.8263, -0.3338, -1.5129) [0.3027, 0.0531, 0.1749] PeriodicSite: O (-1.1622, -1.5719, -3.7030) [0.7412, 0.2500, 0.1113] PeriodicSite: O (-0.3650, -4.7156, -3.3387) [0.6683, 0.7500, 0.0350], 'Pb2TiZrO6': Structure Summary Lattice     abc : 4.505383 5.67298 5.67298  angles : 90.0 90.0 90.0  volume : 144.99539884709878       A : 0.0 0.0 4.505383       B : 5.67298 0.0 0.0       C : 0.0 5.67298 0.0 PeriodicSite: Zr (2.8365, 0.0000, 2.4376) [0.5410, 0.5000, -0.0000] PeriodicSite: Ti (0.0000, 2.8365, 2.4188) [0.5369, -0.0000, 0.5000] PeriodicSite: Pb (0.0000, 0.0000, 4.4114) [0.9791, -0.0000, -0.0000] PeriodicSite: Pb (2.8365, 2.8365, 4.4114) [0.9791, 0.5000, 0.5000] PeriodicSite: O (1.3704, 1.4661, 2.8748) [0.6381, 0.2416, 0.2584] PeriodicSite: O (1.3704, 4.2069, 2.8748) [0.6381, 0.2416, 0.7416] PeriodicSite: O (4.3026, 1.4661, 2.8748) [0.6381, 0.7584, 0.2584] PeriodicSite: O (4.3026, 4.2069, 2.8748) [0.6381, 0.7584, 0.7416] PeriodicSite: O (0.0000, 2.8365, 0.6698) [0.1487, -0.0000, 0.5000] PeriodicSite: O (2.8365, 0.0000, 0.4587) [0.1018, 0.5000, -0.0000], 'Si': Structure Summary Lattice     abc : 3.8401979337 3.840198994344244 3.8401979337177736  angles : 119.99999086398421 90.0 60.0000091373222  volume : 40.04479464425159       A : 3.8401979337 0.0 0.0       B : 1.9200989668 3.3257101909 0.0       C : 0.0 -2.2171384943 3.1355090603 PeriodicSite: Si (0.0000, 0.0000, 0.0000) [0.0000, 0.0000, 0.0000] PeriodicSite: Si (3.8402, 0.0000, 2.3516) [0.7500, 0.5000, 0.7500], 'SiO2': Structure Summary Lattice     abc : 5.0277818 5.0277817873408415 5.51891759  angles : 90.0 90.0 120.00000005747829  volume : 120.81959693044213       A : 5.0277818 6e-08 -0.0       B : -2.51389095 4.35418672 0.0       C : -0.0 0.0 5.51891759 PeriodicSite: Si (1.3140, 2.2760, 5.5189) [0.5227, 0.5227, 1.0000] PeriodicSite: Si (2.3997, -0.0000, 3.6792) [0.4773, -0.0000, 0.6667] PeriodicSite: Si (3.8279, 2.0782, 1.8396) [1.0000, 0.4773, 0.3333] PeriodicSite: O (0.8313, 3.6543, 4.8051) [0.5850, 0.8393, 0.8707] PeriodicSite: O (-1.0664, 3.2469, 2.9655) [0.1607, 0.7457, 0.5373] PeriodicSite: O (0.2352, 1.8071, 1.1259) [0.2543, 0.4150, 0.2040] PeriodicSite: O (2.7491, 2.5470, 0.7137) [0.8393, 0.5850, 0.1293] PeriodicSite: O (3.3452, 0.6999, 2.5533) [0.7457, 0.1607, 0.4626] PeriodicSite: O (1.4474, 1.1073, 4.3929) [0.4150, 0.2543, 0.7960], 'Si_SiO2_Interface': Structure Summary Lattice     abc : 10.160210588671637 10.160210588671637 29.156770002399192  angles : 90.0 90.0 59.99999999999999  volume : 2606.6064276838156       A : 10.160210588671637 0.0 6.221334688039882e-16       B : 5.080105294335819 8.799000477589283 6.221334688039882e-16       C : 0.0 0.0 29.156770002399192 PeriodicSite: Si (10.3416, 3.8758, 9.3499) [0.7976, 0.4405, 0.3207] PeriodicSite: Si (13.9703, 5.1328, 9.3499) [1.0833, 0.5833, 0.3207] PeriodicSite: Si (7.4387, 6.3898, 9.3499) [0.3690, 0.7262, 0.3207] PeriodicSite: Si (11.0674, 7.6468, 9.3499) [0.6548, 0.8690, 0.3207] PeriodicSite: Si (9.6159, 0.1048, 9.3499) [0.9405, 0.0119, 0.3207] PeriodicSite: Si (3.0843, 1.3618, 9.3499) [0.2262, 0.1548, 0.3207] PeriodicSite: Si (6.7130, 2.6188, 9.3499) [0.5119, 0.2976, 0.3207] PeriodicSite: Si (10.3416, 3.8758, 11.7016) [0.7976, 0.4405, 0.4013] PeriodicSite: Si (13.9703, 5.1328, 11.7016) [1.0833, 0.5833, 0.4013] PeriodicSite: Si (7.4387, 6.3898, 11.7016) [0.3690, 0.7262, 0.4013] PeriodicSite: Si (11.0674, 7.6468, 11.7016) [0.6548, 0.8690, 0.4013] PeriodicSite: Si (9.6159, 0.1048, 11.7016) [0.9405, 0.0119, 0.4013] PeriodicSite: Si (3.0843, 1.3618, 11.7016) [0.2262, 0.1548, 0.4013] PeriodicSite: Si (6.7130, 2.6188, 11.7016) [0.5119, 0.2976, 0.4013] PeriodicSite: Si (3.8678, 2.0998, 13.7016) [0.2614, 0.2386, 0.4699] PeriodicSite: Si (6.4078, 6.4993, 13.7016) [0.2614, 0.7386, 0.4699] PeriodicSite: Si (8.9479, 2.0998, 13.7016) [0.7614, 0.2386, 0.4699] PeriodicSite: Si (11.4879, 6.4993, 13.7016) [0.7614, 0.7386, 0.4699] PeriodicSite: Si (4.9647, 4.3995, 15.5412) [0.2386, 0.5000, 0.5330] PeriodicSite: Si (2.4247, 0.0000, 15.5412) [0.2386, 0.0000, 0.5330] PeriodicSite: Si (10.0448, 4.3995, 15.5412) [0.7386, 0.5000, 0.5330] PeriodicSite: Si (7.5048, 0.0000, 15.5412) [0.7386, 0.0000, 0.5330] PeriodicSite: Si (1.3277, 2.2997, 17.3808) [0.0000, 0.2614, 0.5961] PeriodicSite: Si (3.8678, 6.6992, 17.3808) [0.0000, 0.7614, 0.5961] PeriodicSite: Si (6.4078, 2.2997, 17.3808) [0.5000, 0.2614, 0.5961] PeriodicSite: Si (8.9479, 6.6992, 17.3808) [0.5000, 0.7614, 0.5961] PeriodicSite: O (3.3800, 0.7072, 14.4153) [0.2925, 0.0804, 0.4944] PeriodicSite: O (5.9200, 5.1067, 14.4153) [0.2925, 0.5804, 0.4944] PeriodicSite: O (8.4601, 0.7072, 14.4153) [0.7925, 0.0804, 0.4944] PeriodicSite: O (11.0001, 5.1067, 14.4153) [0.7925, 0.5804, 0.4944] PeriodicSite: O (1.4625, 1.1188, 16.2550) [0.0804, 0.1271, 0.5575] PeriodicSite: O (4.0026, 5.5183, 16.2550) [0.0804, 0.6271, 0.5575] PeriodicSite: O (6.5426, 1.1188, 16.2550) [0.5804, 0.1271, 0.5575] PeriodicSite: O (9.0827, 5.5183, 16.2550) [0.5804, 0.6271, 0.5575] PeriodicSite: O (2.7777, 2.5735, 18.0946) [0.1271, 0.2925, 0.6206] PeriodicSite: O (5.3177, 6.9730, 18.0946) [0.1271, 0.7925, 0.6206] PeriodicSite: O (7.8578, 2.5735, 18.0946) [0.6271, 0.2925, 0.6206] PeriodicSite: O (10.3978, 6.9730, 18.0946) [0.6271, 0.7925, 0.6206] PeriodicSite: O (5.3177, 1.8260, 18.5067) [0.4196, 0.2075, 0.6347] PeriodicSite: O (7.8578, 6.2255, 18.5067) [0.4196, 0.7075, 0.6347] PeriodicSite: O (10.3978, 1.8260, 18.5067) [0.9196, 0.2075, 0.6347] PeriodicSite: O (12.9379, 6.2255, 18.5067) [0.9196, 0.7075, 0.6347] PeriodicSite: O (5.9200, 3.6923, 16.6671) [0.3729, 0.4196, 0.5716] PeriodicSite: O (8.4601, 8.0918, 16.6671) [0.3729, 0.9196, 0.5716] PeriodicSite: O (11.0001, 3.6923, 16.6671) [0.8729, 0.4196, 0.5716] PeriodicSite: O (13.5402, 8.0918, 16.6671) [0.8729, 0.9196, 0.5716] PeriodicSite: O (4.0026, 3.2807, 14.8274) [0.2075, 0.3729, 0.5085] PeriodicSite: O (6.5426, 7.6802, 14.8274) [0.2075, 0.8729, 0.5085] PeriodicSite: O (9.0827, 3.2807, 14.8274) [0.7075, 0.3729, 0.5085] PeriodicSite: O (11.6227, 7.6802, 14.8274) [0.7075, 0.8729, 0.5085], 'Sn': Structure Summary Lattice     abc : 6.65061477 6.65061477 6.65061477  angles : 90.0 90.0 90.0  volume : 294.16119253915326       A : 6.65061477 0.0 0.0       B : 0.0 6.65061477 0.0       C : 0.0 0.0 6.65061477 PeriodicSite: Sn (2.4940, 5.8193, 2.4940) [0.3750, 0.8750, 0.3750] PeriodicSite: Sn (0.8313, 0.8313, 0.8313) [0.1250, 0.1250, 0.1250] PeriodicSite: Sn (2.4940, 2.4940, 5.8193) [0.3750, 0.3750, 0.8750] PeriodicSite: Sn (0.8313, 4.1566, 4.1566) [0.1250, 0.6250, 0.6250] PeriodicSite: Sn (5.8193, 5.8193, 5.8193) [0.8750, 0.8750, 0.8750] PeriodicSite: Sn (4.1566, 0.8313, 4.1566) [0.6250, 0.1250, 0.6250] PeriodicSite: Sn (5.8193, 2.4940, 2.4940) [0.8750, 0.3750, 0.3750] PeriodicSite: Sn (4.1566, 4.1566, 0.8313) [0.6250, 0.6250, 0.1250], 'SrTiO3': Structure Summary Lattice     abc : 3.905 3.905 3.905  angles : 90.0 90.0 90.0  volume : 59.54744262499999       A : 3.905 0.0 2.391122875335207e-16       B : -2.391122875335207e-16 3.905 2.391122875335207e-16       C : 0.0 0.0 3.905 PeriodicSite: Sr2+ (1.9525, 1.9525, 1.9525) [0.5000, 0.5000, 0.5000] PeriodicSite: Ti4+ (0.0000, 0.0000, 0.0000) [0.0000, 0.0000, 0.0000] PeriodicSite: O2- (0.0000, 0.0000, 1.9525) [0.0000, 0.0000, 0.5000] PeriodicSite: O2- (-0.0000, 1.9525, 0.0000) [0.0000, 0.5000, 0.0000] PeriodicSite: O2- (1.9525, 0.0000, 0.0000) [0.5000, 0.0000, 0.0000], 'TiO2': <pymatgen.alchemy.materials.TransformedStructure object>, 'TlBiSe2': Structure Summary Lattice     abc : 4.372201544153475 61.149528191254596 59.08304095958131  angles : 3.6737691014605547 58.80413768014368 59.97014152897428  volume : 825.8885392060803       A : 3.74140218 -0.00027862 2.26231209       B : -1.13595131 3.78041753 61.02198666       C : 0.036913 0.04093202 59.08301525 PeriodicSite: Tl (2.5148, 3.6745, 63.4338) [0.9669, 0.9717, 0.0330] PeriodicSite: Tl (3.6037, 0.2035, 6.7146) [0.9793, 0.0537, 0.0207] PeriodicSite: Tl (3.5726, 0.5326, 10.9899) [0.9977, 0.1409, 0.0022] PeriodicSite: Tl (-0.2434, 0.8101, 13.0761) [0.0000, 0.2143, -0.0000] PeriodicSite: Tl (-0.2812, 1.1282, 76.5077) [0.0023, 0.2876, 0.9978] PeriodicSite: Tl (-0.3122, 1.4572, 80.7830) [0.0207, 0.3749, 0.9793] PeriodicSite: Tl (-0.3594, 1.7667, 85.0859) [0.0331, 0.4569, 0.9670] PeriodicSite: Bi (-0.4251, 2.0554, 89.4184) [0.0388, 0.5333, 0.9611] PeriodicSite: Bi (-0.5892, 2.2281, 93.9147) [0.0084, 0.5786, 0.9916] PeriodicSite: Bi (-0.6750, 2.4926, 98.2811) [0.0067, 0.6486, 0.9933] PeriodicSite: Bi (-0.8113, 2.7004, 43.5869) [0.0000, 0.7143, -0.0000] PeriodicSite: Bi (2.8309, 2.9491, 50.2379) [0.9934, 0.7801, 0.0066] PeriodicSite: Bi (2.7442, 3.2126, 54.6058) [0.9914, 0.8498, 0.0086] PeriodicSite: Bi (2.5805, 3.3856, 59.1013) [0.9611, 0.8952, 0.0389] PeriodicSite: Se (1.7377, 0.2085, 35.1484) [0.4743, 0.0495, 0.5256] PeriodicSite: Se (1.6987, 0.5271, 39.4370) [0.4897, 0.1339, 0.5104] PeriodicSite: Se (1.6462, 0.8311, 43.7478) [0.5002, 0.2145, 0.4998] PeriodicSite: Se (1.5935, 1.1347, 48.0594) [0.5106, 0.2949, 0.4893] PeriodicSite: Se (1.5531, 1.4514, 52.3505) [0.5255, 0.3788, 0.4747] PeriodicSite: Se (1.4871, 1.7413, 56.6824) [0.5312, 0.4556, 0.4685] PeriodicSite: Se (1.4204, 2.0277, 61.0185) [0.5364, 0.5314, 0.4634] PeriodicSite: Se (1.2436, 2.1850, 65.5372) [0.5013, 0.5726, 0.4986] PeriodicSite: Se (1.1826, 2.4786, 69.8633) [0.5087, 0.6503, 0.4913] PeriodicSite: Se (1.0777, 2.7207, 74.2599) [0.5000, 0.7143, 0.5000] PeriodicSite: Se (0.9728, 2.9625, 78.6564) [0.4913, 0.7782, 0.5088] PeriodicSite: Se (0.9121, 3.2562, 82.9823) [0.4987, 0.8560, 0.5014] PeriodicSite: Se (0.7353, 3.4138, 87.5010) [0.4636, 0.8973, 0.5365] PeriodicSite: Se (0.6680, 3.6996, 91.8379) [0.4687, 0.9729, 0.5316], 'VO2': <pymatgen.alchemy.materials.TransformedStructure object>}[source]
static assertArrayAlmostEqual(actual, desired, decimal=7, err_msg='', verbose=True)[source]

Tests if two arrays are almost equal to a tolerance. The CamelCase naming is so that it is consistent with standard unittest methods.

static assertArrayEqual(actual, desired, err_msg='', verbose=True)[source]
Tests if two arrays are equal. The CamelCase naming is so that it is

consistent with standard unittest methods.

static assertDictsAlmostEqual(actual, desired, decimal=7, err_msg='', verbose=True)[source]

Tests if two arrays are almost equal to a tolerance. The CamelCase naming is so that it is consistent with standard unittest methods.

assertMSONable(obj, test_if_subclass=True)[source]

Tests if obj is MSONable and tries to verify whether the contract is fulfilled.

By default, the method tests whether obj is an instance of MSONable. This check can be deactivated by setting test_if_subclass to False.

static assertStrContentEqual(actual, desired, err_msg='', verbose=True)[source]

Tests if two strings are equal, ignoring things like trailing spaces, etc.

fn = PosixPath('/Users/shyue/repos/pymatgen/docs_rst/../pymatgen/util/structures/SrTiO3.json')[source]
classmethod get_mp_structure(mpid)[source]

Get a structure from MP.

Parameters

mpid – Materials Project id.

Returns

Structure

classmethod get_structure(name)[source]

Get a structure from the template directories.

Parameters

name – Name of a structure.

Returns

Structure

serialize_with_pickle(objects, protocols=None, test_eq=True)[source]

Test whether the object(s) can be serialized and deserialized with pickle. This method tries to serialize the objects with pickle and the protocols specified in input. Then it deserializes the pickle format and compares the two objects with the __eq__ operator if test_eq == True.

Parameters
  • objects – Object or list of objects.

  • protocols – List of pickle protocols to test. If protocols is None, HIGHEST_PROTOCOL is tested.

Returns

Nested list with the objects deserialized with the specified protocols.

warnings = <module 'warnings' from '/Users/shyue/miniconda3/envs/mavrl/lib/python3.9/warnings.py'>[source]