From c2d3d946b5a2534ae38a52d84fb648ba0ab1eb6a Mon Sep 17 00:00:00 2001 From: Simon Blackburn Date: Tue, 19 Mar 2024 15:31:31 -0400 Subject: [PATCH] code review part 1 - still need to make entry point + example for train_mtp --- .../analysis/ovito_visualisation.py | 5 +- .../local/ovito}/dump.si-10000-4.yaml | 0 .../local/ovito}/mtp_predictions.csv | 0 examples/local/ovito/si_test_thermo_log.yaml | 205 ++++++++++++++++++ tests/analysis/test_ovito_visualisation.py | 20 +- 5 files changed, 208 insertions(+), 22 deletions(-) rename {data/mtp_templates => examples/local/ovito}/dump.si-10000-4.yaml (100%) rename {data/mtp_templates => examples/local/ovito}/mtp_predictions.csv (100%) create mode 100644 examples/local/ovito/si_test_thermo_log.yaml diff --git a/crystal_diffusion/analysis/ovito_visualisation.py b/crystal_diffusion/analysis/ovito_visualisation.py index 44819ff9..c88460bb 100644 --- a/crystal_diffusion/analysis/ovito_visualisation.py +++ b/crystal_diffusion/analysis/ovito_visualisation.py @@ -14,8 +14,8 @@ def main(): """Read MTP output files and convert to xyz format readable by OVITO.""" parser = argparse.ArgumentParser() - parser.add_argument("--prediction_file", help="MTP prediction files. Should contain position and MaxVol gamma") - parser.add_argument("--lammps_output", help="MTP prediction files. Should contain position and MaxVol gamma") + parser.add_argument("--prediction_file", help="MTP prediction files. Should contain position and MaxVol gamma.") + parser.add_argument("--lammps_output", help="LAMMPS output file. Should contain the bounding box information.") parser.add_argument("--output_name", help="Name of the output file that can be loaded by OVITO. ") args = parser.parse_args() @@ -42,7 +42,6 @@ def get_lattice_from_lammps(lammps_output_file: str) -> np.ndarray: for d in l_yaml: # loop over LAMMPS outputs to get the MD box - we only need the first step # lattice in yaml is 3 x 2 [0, x_lim] # we assume a rectangular lattice for now with the 2nd coordinates as the lattice vectors - print(d) lattice = np.zeros((3, 3)) for i, x in enumerate(d['box']): lattice[i, i] = x[1] diff --git a/data/mtp_templates/dump.si-10000-4.yaml b/examples/local/ovito/dump.si-10000-4.yaml similarity index 100% rename from data/mtp_templates/dump.si-10000-4.yaml rename to examples/local/ovito/dump.si-10000-4.yaml diff --git a/data/mtp_templates/mtp_predictions.csv b/examples/local/ovito/mtp_predictions.csv similarity index 100% rename from data/mtp_templates/mtp_predictions.csv rename to examples/local/ovito/mtp_predictions.csv diff --git a/examples/local/ovito/si_test_thermo_log.yaml b/examples/local/ovito/si_test_thermo_log.yaml new file mode 100644 index 00000000..80b325e3 --- /dev/null +++ b/examples/local/ovito/si_test_thermo_log.yaml @@ -0,0 +1,205 @@ +--- +keywords: ['Step', 'Temp', 'KinEng', 'PotEng', 'E_bond', 'E_angle', 'E_dihed', 'E_impro', 'E_vdwl', 'E_coul', 'E_long', 'Press', ] +data: + - [0, 10000, 660.51934095, -2220.33830647777, 0, 0, 0, 0, -2220.33830647777, 0, 0, 69385.9337455044, ] + - [1, 9939.87894502713, 656.54822898921, -2216.35319795722, 0, 0, 0, 0, -2216.35319795722, 0, 0, 69524.7241441595, ] + - [2, 9762.41334348628, 644.826282772104, -2204.50177735189, 0, 0, 0, 0, -2204.50177735189, 0, 0, 69951.2115643612, ] + - [3, 9476.56703801757, 625.945581441986, -2185.15251373313, 0, 0, 0, 0, -2185.15251373313, 0, 0, 70684.7792119354, ] + - [4, 9097.38299289226, 600.899741883493, -2158.95516426486, 0, 0, 0, 0, -2158.95516426486, 0, 0, 71711.1910494951, ] + - [5, 8645.49237153128, 571.051492343209, -2126.85311450021, 0, 0, 0, 0, -2126.85311450021, 0, 0, 72889.3764959544, ] + - [6, 8145.97010538483, 538.057080540719, -2090.07176942437, 0, 0, 0, 0, -2090.07176942437, 0, 0, 74095.1205006849, ] + - [7, 7625.67433812674, 503.69053881188, -2050.03294985751, 0, 0, 0, 0, -2050.03294985751, 0, 0, 75396.6611908646, ] + - [8, 7108.96689446843, 469.561012796966, -2008.27401695962, 0, 0, 0, 0, -2008.27401695962, 0, 0, 76954.8428538581, ] + - [9, 6612.35953588256, 436.75913627656, -1966.42226275157, 0, 0, 0, 0, -1966.42226275157, 0, 0, 78844.5936537931, ] + - [10, 6143.22028769973, 405.77158157421, -1926.18972171051, 0, 0, 0, 0, -1926.18972171051, 0, 0, 80970.9252546512, ] + - [11, 5710.56994867303, 377.194189894638, -1889.30903042821, 0, 0, 0, 0, -1889.30903042821, 0, 0, 83141.2068700119, ] + - [12, 5336.63417904135, 352.495009083164, -1857.34786382504, 0, 0, 0, 0, -1857.34786382504, 0, 0, 85194.6271634101, ] + - [13, 5049.40714445226, 333.523107924183, -1831.47183385966, 0, 0, 0, 0, -1831.47183385966, 0, 0, 87023.7527375095, ] + - [14, 4868.41636506513, 321.568316892301, -1812.28700082248, 0, 0, 0, 0, -1812.28700082248, 0, 0, 88537.2053235755, ] + - [15, 4799.22928162794, 316.998376216883, -1799.8048693906, 0, 0, 0, 0, -1799.8048693906, 0, 0, 89647.8607825366, ] + - [16, 4834.765737971, 319.345627889224, -1793.50869336174, 0, 0, 0, 0, -1793.50869336174, 0, 0, 90295.9915705938, ] + - [17, 4959.6099409286, 327.591828955123, -1792.47757699491, 0, 0, 0, 0, -1792.47757699491, 0, 0, 90488.9983825015, ] + - [18, 5154.86802861341, 340.489003294395, -1795.5374983892, 0, 0, 0, 0, -1795.5374983892, 0, 0, 90295.0563895801, ] + - [19, 5401.37706197265, 356.771401719662, -1801.41778264406, 0, 0, 0, 0, -1801.41778264406, 0, 0, 89817.2772427415, ] + - [20, 5681.06508969164, 375.245336893718, -1808.88812968286, 0, 0, 0, 0, -1808.88812968286, 0, 0, 89167.8961106661, ] + - [21, 5977.63115914611, 394.834099368137, -1816.85992987549, 0, 0, 0, 0, -1816.85992987549, 0, 0, 88439.1499343253, ] + - [22, 6277.12900894199, 414.616511604449, -1824.4432992434, 0, 0, 0, 0, -1824.4432992434, 0, 0, 87697.4845545892, ] + - [23, 6568.36328868675, 433.853099056355, -1830.96299166617, 0, 0, 0, 0, -1830.96299166617, 0, 0, 87007.1676324408, ] + - [24, 6843.0299749935, 451.99536491838, -1835.95173645149, 0, 0, 0, 0, -1835.95173645149, 0, 0, 86429.3744360909, ] + - [25, 7095.61426963593, 468.679046101534, -1839.13222783427, 0, 0, 0, 0, -1839.13222783427, 0, 0, 86027.103648115, ] + - [26, 7323.03108294834, 483.700366466541, -1840.38540508673, 0, 0, 0, 0, -1840.38540508673, 0, 0, 85872.4233269007, ] + - [27, 7524.08653137678, 496.980467695576, -1839.70958289069, 0, 0, 0, 0, -1839.70958289069, 0, 0, 86015.8298466461, ] + - [28, 7698.92295587858, 508.528751684175, -1837.18009645032, 0, 0, 0, 0, -1837.18009645032, 0, 0, 86459.1480194184, ] + - [29, 7848.66108977841, 518.419245036034, -1832.92395716619, 0, 0, 0, 0, -1832.92395716619, 0, 0, 87173.2018586163, ] + - [30, 7975.23204491351, 526.779501422959, -1827.11140581068, 0, 0, 0, 0, -1827.11140581068, 0, 0, 88141.2967623673, ] + - [31, 8081.13782002967, 533.774782701212, -1819.94016921562, 0, 0, 0, 0, -1819.94016921562, 0, 0, 89356.3591820121, ] + - [32, 8169.08743510908, 539.584024880117, -1811.61143719582, 0, 0, 0, 0, -1811.61143719582, 0, 0, 90829.7894297945, ] + - [33, 8241.69459630983, 544.379868306575, -1802.3111084585, 0, 0, 0, 0, -1802.3111084585, 0, 0, 92584.122999169, ] + - [34, 8301.32405784812, 548.318509570222, -1792.20227550079, 0, 0, 0, 0, -1792.20227550079, 0, 0, 94633.7101385657, ] + - [35, 8350.0348499924, 551.535951602651, -1781.42274876938, 0, 0, 0, 0, -1781.42274876938, 0, 0, 96973.6327900294, ] + - [36, 8389.65648969762, 554.153037537196, -1770.09090255989, 0, 0, 0, 0, -1770.09090255989, 0, 0, 99550.9972272482, ] + - [37, 8422.00751049175, 556.289885030596, -1758.32243682479, 0, 0, 0, 0, -1758.32243682479, 0, 0, 102282.400069456, ] + - [38, 8449.11497323479, 558.080385373182, -1746.24551510723, 0, 0, 0, 0, -1746.24551510723, 0, 0, 105108.007002305, ] + - [39, 8473.35412536778, 559.681428252389, -1734.01047010224, 0, 0, 0, 0, -1734.01047010224, 0, 0, 107990.210404469, ] + - [40, 8497.48379431114, 561.27523955517, -1721.79290232849, 0, 0, 0, 0, -1721.79290232849, 0, 0, 110897.805173307, ] + - [41, 8524.57028799474, 563.064354850824, -1709.788971217, 0, 0, 0, 0, -1709.788971217, 0, 0, 113807.666189787, ] + - [42, 8557.81254620896, 565.260070299558, -1698.20529954056, 0, 0, 0, 0, -1698.20529954056, 0, 0, 116712.401311329, ] + - [43, 8600.28325502436, 568.065342759201, -1687.24207436455, 0, 0, 0, 0, -1687.24207436455, 0, 0, 119597.90271506, ] + - [44, 8654.65779334359, 571.656886180709, -1677.07691242764, 0, 0, 0, 0, -1677.07691242764, 0, 0, 122440.425844332, ] + - [45, 8722.95517959326, 576.168060636133, -1667.8488368702, 0, 0, 0, 0, -1667.8488368702, 0, 0, 125256.474709926, ] + - [46, 8806.31098785663, 581.673872989981, -1659.64485137171, 0, 0, 0, 0, -1659.64485137171, 0, 0, 128123.61089118, ] + - [47, 8904.79594526416, 588.178994906011, -1652.48903254985, 0, 0, 0, 0, -1652.48903254985, 0, 0, 131169.728088965, ] + - [48, 9017.34934748041, 595.613364811368, -1646.33795115467, 0, 0, 0, 0, -1646.33795115467, 0, 0, 134471.006658391, ] + - [49, 9141.90672756482, 603.840620671748, -1641.09089276989, 0, 0, 0, 0, -1641.09089276989, 0, 0, 138010.032156195, ] + - [50, 9275.63047305465, 612.673332695779, -1636.60506794232, 0, 0, 0, 0, -1636.60506794232, 0, 0, 141706.205362205, ] + - [51, 9415.17681102113, 621.89063821434, -1632.71170078902, 0, 0, 0, 0, -1632.71170078902, 0, 0, 145425.923163223, ] + - [52, 9557.07953931051, 631.26358787121, -1629.23961515316, 0, 0, 0, 0, -1629.23961515316, 0, 0, 149008.71692104, ] + - [53, 9698.17683525903, 640.583337164185, -1626.04385272229, 0, 0, 0, 0, -1626.04385272229, 0, 0, 152329.465684376, ] + - [54, 9835.82454800808, 649.675234815013, -1623.01754985883, 0, 0, 0, 0, -1623.01754985883, 0, 0, 155344.556915436, ] + - [55, 9967.80275925636, 658.39265092636, -1620.08356446473, 0, 0, 0, 0, -1620.08356446473, 0, 0, 158040.688144583, ] + - [56, 10092.0718137438, 666.60086232341, -1617.17530944046, 0, 0, 0, 0, -1617.17530944046, 0, 0, 160385.140802899, ] + - [57, 10206.623036608, 674.167192146541, -1614.22623858002, 0, 0, 0, 0, -1614.22623858002, 0, 0, 162341.028980002, ] + - [58, 10309.4376090163, 680.958293507262, -1611.16709860217, 0, 0, 0, 0, -1611.16709860217, 0, 0, 163957.657671862, ] + - [59, 10398.4591710488, 686.838339855665, -1607.9218465444, 0, 0, 0, 0, -1607.9218465444, 0, 0, 165347.177051927, ] + - [60, 10471.5861921021, 691.668521030842, -1604.4045923776, 0, 0, 0, 0, -1604.4045923776, 0, 0, 166596.356437136, ] + - [61, 10526.9348966631, 695.32441001675, -1600.52943745871, 0, 0, 0, 0, -1600.52943745871, 0, 0, 167688.206890386, ] + - [62, 10563.4257980173, 697.734704628062, -1596.25562528145, 0, 0, 0, 0, -1596.25562528145, 0, 0, 168619.934463221, ] + - [63, 10581.0186619246, 698.896747315411, -1591.59641275119, 0, 0, 0, 0, -1591.59641275119, 0, 0, 169497.853541632, ] + - [64, 10580.5369403868, 698.864928676142, -1586.60423040284, 0, 0, 0, 0, -1586.60423040284, 0, 0, 170382.487043334, ] + - [65, 10563.4949348974, 697.739271252706, -1581.35851456459, 0, 0, 0, 0, -1581.35851456459, 0, 0, 171283.429174553, ] + - [66, 10532.0131950029, 695.659841443999, -1575.96012002173, 0, 0, 0, 0, -1575.96012002173, 0, 0, 172191.387942149, ] + - [67, 10488.8600868923, 692.809495191087, -1570.53743144269, 0, 0, 0, 0, -1570.53743144269, 0, 0, 173059.864966486, ] + - [68, 10437.2814586338, 689.402627036647, -1565.24121392192, 0, 0, 0, 0, -1565.24121392192, 0, 0, 173820.567770469, ] + - [69, 10380.4301613786, 685.647488897132, -1560.2058575146, 0, 0, 0, 0, -1560.2058575146, 0, 0, 174485.824201043, ] + - [70, 10320.6589674629, 681.699485935832, -1555.50770458175, 0, 0, 0, 0, -1555.50770458175, 0, 0, 175190.754387066, ] + - [71, 10259.0811268539, 677.632150466211, -1551.13294062101, 0, 0, 0, 0, -1551.13294062101, 0, 0, 176008.275952724, ] + - [72, 10195.875065348, 673.457267857223, -1547.00223376438, 0, 0, 0, 0, -1547.00223376438, 0, 0, 176879.630575924, ] + - [73, 10131.0135238105, 669.173037590282, -1543.02434887272, 0, 0, 0, 0, -1543.02434887272, 0, 0, 177726.205205999, ] + - [74, 10064.7355092173, 664.795246538426, -1539.12591845887, 0, 0, 0, 0, -1539.12591845887, 0, 0, 178565.114831397, ] + - [75, 9997.75188999236, 660.370848935937, -1535.26407721075, 0, 0, 0, 0, -1535.26407721075, 0, 0, 179449.845280929, ] + - [76, 9931.38251060714, 655.987023062859, -1531.43620657878, 0, 0, 0, 0, -1531.43620657878, 0, 0, 180374.242337545, ] + - [77, 9867.68008149097, 651.779354413186, -1527.69084998512, 0, 0, 0, 0, -1527.69084998512, 0, 0, 181304.256802584, ] + - [78, 9809.42876749256, 647.931742460015, -1524.13064047689, 0, 0, 0, 0, -1524.13064047689, 0, 0, 182232.692486718, ] + - [79, 9759.90746224375, 644.660764469423, -1520.90111262797, 0, 0, 0, 0, -1520.90111262797, 0, 0, 183158.400704616, ] + - [80, 9722.29395724953, 642.176319716463, -1518.15360887581, 0, 0, 0, 0, -1518.15360887581, 0, 0, 184046.988036136, ] + - [81, 9699.04379283344, 640.640601388753, -1516.00153411162, 0, 0, 0, 0, -1516.00153411162, 0, 0, 184870.666899117, ] + - [82, 9691.79677205791, 640.161921650103, -1514.52030321899, 0, 0, 0, 0, -1514.52030321899, 0, 0, 185619.790443674, ] + - [83, 9701.53954928604, 640.805450929477, -1513.76209883592, 0, 0, 0, 0, -1513.76209883592, 0, 0, 186233.413616857, ] + - [84, 9728.69673823151, 642.599235783909, -1513.76174959414, 0, 0, 0, 0, -1513.76174959414, 0, 0, 186632.980529851, ] + - [85, 9773.04736595198, 645.528680523173, -1514.53692493212, 0, 0, 0, 0, -1514.53692493212, 0, 0, 186839.399670292, ] + - [86, 9833.22521038999, 649.503543537972, -1516.05110225842, 0, 0, 0, 0, -1516.05110225842, 0, 0, 186920.283762064, ] + - [87, 9906.29166325646, 654.329724067264, -1518.18083506128, 0, 0, 0, 0, -1518.18083506128, 0, 0, 186872.08216263, ] + - [88, 9987.91217058702, 659.720916438262, -1520.72808170226, 0, 0, 0, 0, -1520.72808170226, 0, 0, 186718.568407142, ] + - [89, 10072.9692849852, 665.339103352802, -1523.45579638944, 0, 0, 0, 0, -1523.45579638944, 0, 0, 186556.089358712, ] + - [90, 10156.4020835236, 670.850001063223, -1526.13923231781, 0, 0, 0, 0, -1526.13923231781, 0, 0, 186483.890772344, ] + - [91, 10233.9625741736, 675.97302148001, -1528.61058833519, 0, 0, 0, 0, -1528.61058833519, 0, 0, 186581.365758555, ] + - [92, 10302.6060707179, 680.507057189806, -1530.7786746701, 0, 0, 0, 0, -1530.7786746701, 0, 0, 186897.543482386, ] + - [93, 10360.385865261, 684.323524370992, -1532.61742113555, 0, 0, 0, 0, -1532.61742113555, 0, 0, 187415.618586825, ] + - [94, 10405.9847172902, 687.335416740026, -1534.12759708477, 0, 0, 0, 0, -1534.12759708477, 0, 0, 188020.32214419, ] + - [95, 10438.3547851531, 689.473522329159, -1535.30956523479, 0, 0, 0, 0, -1535.30956523479, 0, 0, 188523.008402251, ] + - [96, 10456.6885077519, 690.684500165974, -1536.16150372239, 0, 0, 0, 0, -1536.16150372239, 0, 0, 188770.131151138, ] + - [97, 10460.4718290933, 690.934395857874, -1536.68170166318, 0, 0, 0, 0, -1536.68170166318, 0, 0, 188728.815075972, ] + - [98, 10449.5433155783, 690.212546403424, -1536.86793873074, 0, 0, 0, 0, -1536.86793873074, 0, 0, 188483.442318225, ] + - [99, 10424.3479989504, 688.548347010018, -1536.73398476568, 0, 0, 0, 0, -1536.73398476568, 0, 0, 188118.668858725, ] + - [100, 10386.2211165483, 686.029992686348, -1536.33137471991, 0, 0, 0, 0, -1536.33137471991, 0, 0, 187656.943526385, ] + - [101, 10337.4427174854, 682.808085086185, -1535.75294205479, 0, 0, 0, 0, -1535.75294205479, 0, 0, 187053.892308877, ] + - [102, 10280.9050106416, 679.073660199854, -1535.11975893604, 0, 0, 0, 0, -1535.11975893604, 0, 0, 186251.402292898, ] + - [103, 10219.4107503711, 675.011845373245, -1534.53131071262, 0, 0, 0, 0, -1534.53131071262, 0, 0, 185234.161409149, ] + - [104, 10155.287186083, 670.776359930951, -1534.04588862574, 0, 0, 0, 0, -1534.04588862574, 0, 0, 184010.458393779, ] + - [105, 10090.5183303956, 666.498251743679, -1533.69846717746, 0, 0, 0, 0, -1533.69846717746, 0, 0, 182566.809141875, ] + - [106, 10026.7831414558, 662.288419244295, -1533.50852378196, 0, 0, 0, 0, -1533.50852378196, 0, 0, 180902.439985777, ] + - [107, 9965.24142169685, 658.223469626684, -1533.46552243235, 0, 0, 0, 0, -1533.46552243235, 0, 0, 179079.981120689, ] + - [108, 9906.35873069873, 654.334154001541, -1533.51945334345, 0, 0, 0, 0, -1533.51945334345, 0, 0, 177199.60414097, ] + - [109, 9849.89387800499, 650.60454127273, -1533.5791263997, 0, 0, 0, 0, -1533.5791263997, 0, 0, 175361.964811266, ] + - [110, 9795.1361179927, 646.987685317208, -1533.5260770168, 0, 0, 0, 0, -1533.5260770168, 0, 0, 173631.169640535, ] + - [111, 9741.47252568002, 643.44310125447, -1533.25232097748, 0, 0, 0, 0, -1533.25232097748, 0, 0, 172023.304781199, ] + - [112, 9688.96987586564, 639.975199689118, -1532.6998525927, 0, 0, 0, 0, -1532.6998525927, 0, 0, 170536.049025453, ] + - [113, 9638.65649444894, 636.651903535685, -1531.87780135039, 0, 0, 0, 0, -1531.87780135039, 0, 0, 169172.598448917, ] + - [114, 9592.51927715046, 633.604451099359, -1530.86244692457, 0, 0, 0, 0, -1530.86244692457, 0, 0, 167856.713038414, ] + - [115, 9553.32406223751, 631.01553134709, -1529.78665767672, 0, 0, 0, 0, -1529.78665767672, 0, 0, 166461.784894274, ] + - [116, 9524.26401116471, 629.096058768832, -1528.81983530829, 0, 0, 0, 0, -1528.81983530829, 0, 0, 164948.776737596, ] + - [117, 9508.44560811416, 628.051222653049, -1528.13479442348, 0, 0, 0, 0, -1528.13479442348, 0, 0, 163394.046624479, ] + - [118, 9508.4549853171, 628.051842035439, -1527.88112051872, 0, 0, 0, 0, -1527.88112051872, 0, 0, 161906.620518054, ] + - [119, 9526.1384191106, 629.21986703894, -1528.17616350467, 0, 0, 0, 0, -1528.17616350467, 0, 0, 160549.637453899, ] + - [120, 9562.44384806798, 631.617910839725, -1529.09667949446, 0, 0, 0, 0, -1529.09667949446, 0, 0, 159330.452693083, ] + - [121, 9617.26466854641, 635.238932061, -1530.67185841824, 0, 0, 0, 0, -1530.67185841824, 0, 0, 158265.854120177, ] + - [122, 9689.28953219329, 639.996313607804, -1532.87461506322, 0, 0, 0, 0, -1532.87461506322, 0, 0, 157389.015511296, ] + - [123, 9775.91570098798, 645.718139599934, -1535.61539298268, 0, 0, 0, 0, -1535.61539298268, 0, 0, 156698.987791662, ] + - [124, 9873.27874323265, 652.149156849567, -1538.74427397079, 0, 0, 0, 0, -1538.74427397079, 0, 0, 156141.245067023, ] + - [125, 9976.35381419425, 658.95746464356, -1542.05152139044, 0, 0, 0, 0, -1542.05152139044, 0, 0, 155633.929689666, ] + - [126, 10079.2851726989, 665.756279951822, -1545.2827141373, 0, 0, 0, 0, -1545.2827141373, 0, 0, 155111.357586577, ] + - [127, 10176.0193968752, 672.145762551844, -1548.17461845004, 0, 0, 0, 0, -1548.17461845004, 0, 0, 154579.138727192, ] + - [128, 10260.9813324796, 677.757662722966, -1550.49150155069, 0, 0, 0, 0, -1550.49150155069, 0, 0, 154105.53572388, ] + - [129, 10329.5848116889, 682.289055210386, -1552.04973160137, 0, 0, 0, 0, -1552.04973160137, 0, 0, 153741.423092147, ] + - [130, 10378.6579620033, 685.530431700792, -1552.73788531959, 0, 0, 0, 0, -1552.73788531959, 0, 0, 153531.752689599, ] + - [131, 10406.580366997, 687.374760555209, -1552.52665872601, 0, 0, 0, 0, -1552.52665872601, 0, 0, 153569.898838628, ] + - [132, 10412.8533397102, 687.789102535437, -1551.42918827255, 0, 0, 0, 0, -1551.42918827255, 0, 0, 153976.906040286, ] + - [133, 10397.8945717674, 686.801046981139, -1549.48200391658, 0, 0, 0, 0, -1549.48200391658, 0, 0, 154824.117964659, ] + - [134, 10363.5466064392, 684.532297438983, -1546.78737032597, 0, 0, 0, 0, -1546.78737032597, 0, 0, 156100.54813203, ] + - [135, 10313.3570872659, 681.217182626288, -1543.53746011493, 0, 0, 0, 0, -1543.53746011493, 0, 0, 157691.378614494, ] + - [136, 10252.1481340135, 677.174212880039, -1539.98500971823, 0, 0, 0, 0, -1539.98500971823, 0, 0, 159446.935334684, ] + - [137, 10185.4487203074, 672.768587601749, -1536.41325581104, 0, 0, 0, 0, -1536.41325581104, 0, 0, 161227.085908839, ] + - [138, 10118.9430178168, 668.375757323896, -1533.10992535358, 0, 0, 0, 0, -1533.10992535358, 0, 0, 162950.478191107, ] + - [139, 10057.8304979011, 664.339157186047, -1530.33129404225, 0, 0, 0, 0, -1530.33129404225, 0, 0, 164570.846706089, ] + - [140, 10006.1533533162, 660.925781837703, -1528.26732581608, 0, 0, 0, 0, -1528.26732581608, 0, 0, 166049.070810894, ] + - [141, 9966.21222615547, 658.287593138804, -1527.00267315355, 0, 0, 0, 0, -1527.00267315355, 0, 0, 167323.722006917, ] + - [142, 9938.45952470147, 656.454473531406, -1526.5138657637, 0, 0, 0, 0, -1526.5138657637, 0, 0, 168368.310639331, ] + - [143, 9921.88041317325, 655.359391149391, -1526.69570013615, 0, 0, 0, 0, -1526.69570013615, 0, 0, 169199.617148867, ] + - [144, 9914.64151102057, 654.881247661482, -1527.40191718232, 0, 0, 0, 0, -1527.40191718232, 0, 0, 169824.022249371, ] + - [145, 9914.79364694169, 654.891296533317, -1528.49364132392, 0, 0, 0, 0, -1528.49364132392, 0, 0, 170284.610262033, ] + - [146, 9920.55349753161, 655.27174580488, -1529.85482047951, 0, 0, 0, 0, -1529.85482047951, 0, 0, 170665.923332187, ] + - [147, 9930.16877590256, 655.906853538142, -1531.37757217558, 0, 0, 0, 0, -1531.37757217558, 0, 0, 171070.102124787, ] + - [148, 9941.77632766158, 656.673554781934, -1532.95090167036, 0, 0, 0, 0, -1532.95090167036, 0, 0, 171522.132231567, ] + - [149, 9953.38546345742, 657.44036065442, -1534.45682992102, 0, 0, 0, 0, -1534.45682992102, 0, 0, 171995.634796304, ] + - [150, 9963.03864331037, 658.077971853875, -1535.77913636977, 0, 0, 0, 0, -1535.77913636977, 0, 0, 172468.176532307, ] + - [151, 9969.05211633044, 658.475173377478, -1536.81816916406, 0, 0, 0, 0, -1536.81816916406, 0, 0, 172849.059831233, ] + - [152, 9970.18389090312, 658.549929276963, -1537.49890046847, 0, 0, 0, 0, -1537.49890046847, 0, 0, 173029.904356429, ] + - [153, 9965.79725493436, 658.260183487056, -1537.77880032014, 0, 0, 0, 0, -1537.77880032014, 0, 0, 172954.277704737, ] + - [154, 9956.07569651602, 657.618055751107, -1537.66351602758, 0, 0, 0, 0, -1537.66351602758, 0, 0, 172590.42345679, ] + - [155, 9942.06259902409, 656.692463559104, -1537.20959593057, 0, 0, 0, 0, -1537.20959593057, 0, 0, 171953.989735172, ] + - [156, 9925.61375850191, 655.605985828994, -1536.51935431992, 0, 0, 0, 0, -1536.51935431992, 0, 0, 171150.295762357, ] + - [157, 9909.51808072272, 654.542835181108, -1535.75420797773, 0, 0, 0, 0, -1535.75420797773, 0, 0, 170353.630407388, ] + - [158, 9897.60541405648, 653.755980507574, -1535.14551505462, 0, 0, 0, 0, -1535.14551505462, 0, 0, 169723.096004298, ] + - [159, 9894.50368288807, 653.551105164857, -1534.98673337341, 0, 0, 0, 0, -1534.98673337341, 0, 0, 169302.149985118, ] + - [160, 9904.59285269133, 654.217514343776, -1535.57025651291, 0, 0, 0, 0, -1535.57025651291, 0, 0, 169030.789410447, ] + - [161, 9930.09165774666, 655.901759734791, -1537.06390427613, 0, 0, 0, 0, -1537.06390427613, 0, 0, 168822.026793191, ] + - [162, 9969.15694430015, 658.482097467625, -1539.37936210769, 0, 0, 0, 0, -1539.37936210769, 0, 0, 168632.872555156, ] + - [163, 10015.5484517697, 661.546346261572, -1542.14454718616, 0, 0, 0, 0, -1542.14454718616, 0, 0, 168481.470540642, ] + - [164, 10060.4868146603, 664.514612045556, -1544.82571576993, 0, 0, 0, 0, -1544.82571576993, 0, 0, 168445.452938048, ] + - [165, 10095.3548561203, 666.817713622094, -1546.90652869132, 0, 0, 0, 0, -1546.90652869132, 0, 0, 168627.906877985, ] + - [166, 10113.5130152812, 668.017095154276, -1547.99443685675, 0, 0, 0, 0, -1547.99443685675, 0, 0, 169090.343954006, ] + - [167, 10111.1044659292, 667.858005811214, -1547.8594876193, 0, 0, 0, 0, -1547.8594876193, 0, 0, 169752.699166626, ] + - [168, 10087.3864408435, 666.291384381389, -1546.45263308351, 0, 0, 0, 0, -1546.45263308351, 0, 0, 170499.745881864, ] + - [169, 10044.6718789073, 663.470004951484, -1543.896906133, 0, 0, 0, 0, -1543.896906133, 0, 0, 171291.451064487, ] + - [170, 9988.03810990092, 659.729234973524, -1540.47386490151, 0, 0, 0, 0, -1540.47386490151, 0, 0, 172072.475787801, ] + - [171, 9924.69628341327, 655.545384824905, -1536.5896022876, 0, 0, 0, 0, -1536.5896022876, 0, 0, 172760.118363886, ] + - [172, 9863.00680918859, 651.470675739061, -1532.71805534368, 0, 0, 0, 0, -1532.71805534368, 0, 0, 173257.085108127, ] + - [173, 9811.24902355573, 648.051973893536, -1529.33312020802, 0, 0, 0, 0, -1529.33312020802, 0, 0, 173538.909788201, ] + - [174, 9776.23727535659, 645.739380208936, -1526.8210987733, 0, 0, 0, 0, -1526.8210987733, 0, 0, 173642.345871532, ] + - [175, 9762.41729976135, 644.826544091724, -1525.4268328274, 0, 0, 0, 0, -1525.4268328274, 0, 0, 173572.823552406, ] + - [176, 9771.79573495457, 645.446007875021, -1525.25736969527, 0, 0, 0, 0, -1525.25736969527, 0, 0, 173333.032220731, ] + - [177, 9804.26271211692, 647.590514510813, -1526.30869629486, 0, 0, 0, 0, -1526.30869629486, 0, 0, 172915.555776403, ] + - [178, 9857.92661582298, 651.135119141686, -1528.48801448833, 0, 0, 0, 0, -1528.48801448833, 0, 0, 172302.387218671, ] + - [179, 9929.39576759494, 655.855794844353, -1531.63157311358, 0, 0, 0, 0, -1531.63157311358, 0, 0, 171481.909774263, ] + - [180, 10014.0536356098, 661.447610763091, -1535.52030174124, 0, 0, 0, 0, -1535.52030174124, 0, 0, 170492.90549837, ] + - [181, 10106.4036094146, 667.547505146523, -1539.89740167759, 0, 0, 0, 0, -1539.89740167759, 0, 0, 169438.120745827, ] + - [182, 10200.555548657, 673.766422832281, -1544.49561135463, 0, 0, 0, 0, -1544.49561135463, 0, 0, 168419.278139153, ] + - [183, 10290.7915794192, 679.726687189176, -1549.06577932115, 0, 0, 0, 0, -1549.06577932115, 0, 0, 167503.422896491, ] + - [184, 10372.2924344834, 685.109976296562, -1553.41679708038, 0, 0, 0, 0, -1553.41679708038, 0, 0, 166711.91895578, ] + - [185, 10441.7274596378, 689.696294001945, -1557.45592468616, 0, 0, 0, 0, -1557.45592468616, 0, 0, 166058.827330075, ] + - [186, 10496.9564702597, 693.34427697168, -1561.1590044414, 0, 0, 0, 0, -1561.1590044414, 0, 0, 165467.132084282, ] + - [187, 10536.1060583167, 695.930182981864, -1564.50063547209, 0, 0, 0, 0, -1564.50063547209, 0, 0, 164819.110018913, ] + - [188, 10556.9255830024, 697.305352854292, -1567.40424610299, 0, 0, 0, 0, -1567.40424610299, 0, 0, 164056.866245719, ] + - [189, 10556.726885948, 697.292228529554, -1569.73460241218, 0, 0, 0, 0, -1569.73460241218, 0, 0, 163182.04962526, ] + - [190, 10532.7860617076, 695.710890784643, -1571.31193815617, 0, 0, 0, 0, -1571.31193815617, 0, 0, 162265.385778569, ] + - [191, 10483.2383924905, 692.438171402953, -1571.960324199, 0, 0, 0, 0, -1571.960324199, 0, 0, 161388.768875671, ] + - [192, 10408.2087260336, 687.482316818976, -1571.58341301434, 0, 0, 0, 0, -1571.58341301434, 0, 0, 160635.148743659, ] + - [193, 10310.2391144466, 681.01123449112, -1570.19462831736, 0, 0, 0, 0, -1570.19462831736, 0, 0, 160034.822773315, ] + - [194, 10193.8084788222, 673.320765820218, -1567.89334448315, 0, 0, 0, 0, -1567.89334448315, 0, 0, 159600.436494009, ] + - [195, 10064.5956060117, 664.786005661113, -1564.83629381441, 0, 0, 0, 0, -1564.83629381441, 0, 0, 159370.489005132, ] + - [196, 9928.76754886047, 655.814299781906, -1561.2148836029, 0, 0, 0, 0, -1561.2148836029, 0, 0, 159379.756121926, ] + - [197, 9792.29972113502, 646.800335818897, -1557.23064562808, 0, 0, 0, 0, -1557.23064562808, 0, 0, 159672.001988202, ] + - [198, 9660.33505513251, 638.08381439723, -1553.06177878826, 0, 0, 0, 0, -1553.06177878826, 0, 0, 160328.491884611, ] + - [199, 9536.83867385388, 629.926639560044, -1548.839729601, 0, 0, 0, 0, -1548.839729601, 0, 0, 161380.303064434, ] + - [200, 9424.78260640537, 622.52511957799, -1544.65718960456, 0, 0, 0, 0, -1544.65718960456, 0, 0, 162770.698890366, ] +... diff --git a/tests/analysis/test_ovito_visualisation.py b/tests/analysis/test_ovito_visualisation.py index 58d2d820..20377056 100644 --- a/tests/analysis/test_ovito_visualisation.py +++ b/tests/analysis/test_ovito_visualisation.py @@ -9,24 +9,6 @@ get_lattice_from_lammps, mtp_predictions_to_ovito) -@pytest.fixture -def lammps_output(tmpdir): - lattice_output = """ -box: - - [0, 4.0] - - [0, 5.0] - - [0, 6.0] ---- -box: - - [0, 4.0] - - [0, 5.0] - - [0, 6.0] -""" - with open(os.path.join(tmpdir, "test_output.yaml"), "w") as f: - f.write(lattice_output) - return os.path.join(tmpdir, "test_output.yaml") - - class TestMTP2Ovito: """This class tests the functions to convert outputs to OVITO readable files.""" @@ -47,7 +29,7 @@ def lammps_output(self, tmpdir): f.write(lattice_output) return os.path.join(tmpdir, "test_output.yaml") - def test_get_lattice_from_lammps(self, lammps_output, tmpdir): + def test_get_lattice_from_lammps(self, lammps_output): # Get the lattice array from the function using the test file lattice = get_lattice_from_lammps(lammps_output)