pymatgen.util.testing module

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 = '/Users/shyuep/repos/pymatgen/pymatgen/util'
STRUCTURES_DIR = '/Users/shyuep/repos/pymatgen/pymatgen/util/structures'

Dict for test structures to aid testing.

TEST_STRUCTURES = {'BaNiO3': <pymatgen.alchemy.materials.TransformedStructure object>, 'CsCl': Structure Summary Lattice abc : 4.2089999999999996 4.2089999999999996 4.2089999999999996 angles : 90.0 90.0 90.0 volume : 74.565301328999979 A : 4.2089999999999996 0.0 0.0 B : 0.0 4.2089999999999996 0.0 C : 0.0 0.0 4.2089999999999996 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.4700000000000002 6.7999999999999998 angles : 90.0 90.0 120.00000000000001 volume : 35.928033824449685 A : -1.2350000000000005 -2.139082747347564 -3.0248775938939629e-16 B : -1.2349999999999997 2.139082747347564 1.5124387969469814e-16 C : 0.0 0.0 -6.7999999999999998 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], 'K2O2': Structure Summary Lattice abc : 4.862375062662279 4.8623750626622781 6.3609999999999998 angles : 90.0 90.0 91.891493085026752 volume : 150.30921504900002 A : 3.3810000000000002 -3.4945000000000004 0.0 B : 3.3809999999999998 3.4944999999999995 4.2795282396204257e-16 C : 0.0 0.0 -6.3609999999999998 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], 'Li10GeP2S12': Structure Summary Lattice abc : 8.69407 8.69407 12.599399999999999 angles : 90.0 90.0 90.0 volume : 952.34899776584109 A : -8.69407 0.0 -5.3235824985315143e-16 B : 5.3235824985315143e-16 -8.69407 -5.3235824985315143e-16 C : 0.0 0.0 -12.599399999999999 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.2597622612699841 3.2597622612699841 3.2597622612699841 angles : 60.000000000000007 60.000000000000007 60.000000000000007 volume : 24.493045250000005 A : -2.3050000000000002 -2.3050000000000002 4.4408920985006262e-16 B : -2.3050000000000002 0.0 -2.3049999999999997 C : 1.4114054360173247e-16 -2.3050000000000002 -2.3050000000000002 PeriodicSite: Li+ (-1.1525, -1.1525, -1.1525) [0.2500, 0.2500, 0.2500] PeriodicSite: Li+ (-3.4575, -3.4575, -3.4575) [0.7500, 0.7500, 0.7500] PeriodicSite: O2- (0.0000, 0.0000, 0.0000) [0.0000, 0.0000, 0.0000], 'Li2O2': Structure Summary Lattice abc : 3.1830000000000007 3.1830000000000003 7.7257999999999996 angles : 90.0 90.0 120.00000000000001 volume : 67.787149234437805 A : -1.5915000000000006 -2.7565588602458688 -3.8980507616860249e-16 B : -1.5914999999999992 2.7565588602458688 1.9490253808430124e-16 C : 0.0 0.0 -7.7257999999999996 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.6406799999999997 8.6726500000000009 8.6406799999999997 angles : 61.213169999999998 61.344200000000001 61.213169999999998 volume : 470.79781863226867 A : -2.4709394784159961 -7.1684244513879261 -4.143609518420984 B : -7.6008613010259687 0.0 -4.1763339791096499 C : 0.0 0.0 -8.6406799999999997 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.7447999999999997 6.0657700000000006 10.41037 angles : 90.501789999999986 90.000190000000003 90.003619999999998 volume : 299.60796771125047 A : 0.0 0.0 -4.7447999999999997 B : -0.053122654367700306 -6.0655373652809468 0.00038324092231544317 C : 10.410369999942761 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.9954999999999998 6.2874600000000003 10.440590000000002 angles : 90.0 89.97269 90.0 volume : 327.92852119118442 A : 0.0 0.0 -4.9954999999999998 B : 3.849958881883509e-16 -6.2874600000000003 -3.849958881883509e-16 C : -10.440588813976833 0.0 -0.0049765009661513291 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], 'Si': Structure Summary Lattice abc : 3.8401979336999998 3.8401989943442438 3.8401979337177736 angles : 119.99999086398421 90.0 60.000009137322202 volume : 40.044794644251589 A : 3.8401979336999998 0.0 0.0 B : 1.9200989667999999 3.3257101909000002 0.0 C : 0.0 -2.2171384942999999 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], 'Sn': Structure Summary Lattice abc : 6.6506147699999998 6.6506147699999998 6.6506147699999998 angles : 90.0 90.0 90.0 volume : 294.16119253915326 A : 6.6506147699999998 0.0 0.0 B : 0.0 6.6506147699999998 0.0 C : 0.0 0.0 6.6506147699999998 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.9049999999999998 3.9049999999999998 3.9049999999999998 angles : 90.0 90.0 90.0 volume : 59.547442624999988 A : 3.9049999999999998 0.0 2.3911228753352071e-16 B : -2.3911228753352071e-16 3.9049999999999998 2.3911228753352071e-16 C : 0.0 0.0 3.9049999999999998 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>, 'VO2': <pymatgen.alchemy.materials.TransformedStructure object>}
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.
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.

fn = 'VO2.json'
classmethod get_mp_structure(mpid)[source]
classmethod get_structure(name)[source]
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.

tmpfile_write(string)[source]

Write string to a temporary file. Returns the name of the temporary file.