diff --git a/mdproptools/structural/cluster_analysis.py b/mdproptools/structural/cluster_analysis.py index c06b718..034b8ba 100644 --- a/mdproptools/structural/cluster_analysis.py +++ b/mdproptools/structural/cluster_analysis.py @@ -450,7 +450,7 @@ def get_unique_configurations( "configurations" ) merge_cols = [i for i in list(df.columns) if i.startswith("atoms_")] - print(df) + df = df.sort_values("cluster") top_config = top_config.merge( df[["cluster"] + merge_cols], on=merge_cols ).drop_duplicates(merge_cols) diff --git a/tests/structural/test_files/clusters.csv b/tests/structural/test_files/clusters.csv index 365e302..112da1f 100644 --- a/tests/structural/test_files/clusters.csv +++ b/tests/structural/test_files/clusters.csv @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b6cdb35ff9e258cb40379f4d4e0cc9a109b636ae764fc85e6f43b88d0f66b48e +oid sha256:d07f1941a78ad9b677152002f8b90a9fbc8659966ec75246e44de4f415435106 size 1250 diff --git a/tests/structural/test_files/conf_1.xyz b/tests/structural/test_files/conf_1.xyz index 260db85..70c086c 100644 --- a/tests/structural/test_files/conf_1.xyz +++ b/tests/structural/test_files/conf_1.xyz @@ -1,53 +1,53 @@ 63 -Mg 13.7489000000 22.9273000000 7.8350300000 -O 11.7598000000 23.3384000000 8.0880600000 -O 13.1442000000 21.1897000000 7.2613500000 -C 11.0747000000 22.1626000000 7.7789100000 -C 11.9100000000 20.8873000000 7.9258800000 -C 10.8354000000 24.4501000000 8.1207000000 -C 13.5689000000 20.0474000000 6.5015600000 -H 10.1351000000 22.0032000000 8.3057400000 -H 10.7055000000 22.3382000000 6.7727700000 -H 12.2133000000 20.5840000000 8.9555100000 -H 11.3076000000 20.0938000000 7.4919800000 -H 10.1508000000 24.4619000000 7.2848400000 -H 10.2654000000 24.5646000000 9.0503700000 -H 11.4641000000 25.3375000000 8.1032800000 -H 14.5970000000 20.2159000000 6.1878900000 -H 13.5402000000 19.1528000000 7.0765500000 -H 12.9883000000 20.0894000000 5.5390500000 -O 15.6437000000 22.3356000000 7.4732900000 -O 14.2090000000 22.2881000000 9.5941000000 -C 16.3790000000 21.7474000000 8.6136200000 -C 15.3933000000 21.5253000000 9.7574000000 -C 16.3320000000 22.3115000000 6.2393900000 -C 13.4367000000 22.5015000000 10.8006000000 -H 16.9397000000 20.8771000000 8.2982700000 -H 17.0385000000 22.5795000000 8.9610700000 -H 14.9908000000 20.5590000000 9.8759200000 -H 15.7888000000 21.8478000000 10.7223000000 -H 15.7485000000 22.5706000000 5.3346400000 -H 17.2274000000 23.0099000000 6.3177200000 -H 16.6782000000 21.2364000000 6.0077500000 -H 12.4396000000 23.0196000000 10.7492000000 -H 13.3635000000 21.6290000000 11.3822000000 -H 14.0691000000 23.1348000000 11.3668000000 -N 11.1656000000 24.0083000000 4.8759400000 -S 10.0119000000 24.0942000000 3.8320500000 -O 10.4210000000 24.2245000000 2.4558400000 -O 8.9786600000 23.1413000000 4.1042100000 -C 9.2355300000 25.6044000000 4.2509900000 -F 9.1050000000 25.7960000000 5.5863100000 -F 8.0206700000 25.6854000000 3.8016900000 -F 9.8151300000 26.6755000000 3.8113800000 -S 12.7154000000 23.9470000000 4.6463700000 -O 13.1852000000 23.1107000000 3.5673500000 -O 13.4213000000 23.7262000000 5.9377400000 -C 13.0494000000 25.7154000000 4.2551800000 -F 14.2690000000 25.9423000000 3.9253100000 -F 12.2986000000 25.9862000000 3.1515000000 -F 12.6983000000 26.5223000000 5.2551000000 +Mg 19.4720000000 25.8949000000 12.6780000000 +O 21.2788000000 25.4802000000 13.3065000000 +O 19.6312000000 27.6705000000 13.4600000000 +C 21.4506000000 26.3740000000 14.4589000000 +C 20.9504000000 27.7716000000 14.0079000000 +C 22.5339000000 25.1872000000 12.8168000000 +C 19.2640000000 28.9128000000 12.8689000000 +H 20.7384000000 26.0766000000 15.2657000000 +H 22.4839000000 26.4405000000 14.8185000000 +H 21.1198000000 28.4710000000 14.8461000000 +H 21.5420000000 28.2503000000 13.2669000000 +H 22.5083000000 24.6145000000 11.8887000000 +H 23.0370000000 26.0824000000 12.4502000000 +H 23.1397000000 24.6736000000 13.5795000000 +H 19.0579000000 29.6019000000 13.6307000000 +H 20.0262000000 29.2315000000 12.2125000000 +H 18.3379000000 28.7784000000 12.3539000000 +O 18.7493000000 25.0300000000 14.2679000000 +O 19.4299000000 23.9711000000 11.8056000000 +C 18.8227000000 23.5695000000 14.2524000000 +C 19.5909000000 23.0787000000 12.9022000000 +C 18.1564000000 25.6425000000 15.3925000000 +C 19.7267000000 23.2510000000 10.6033000000 +H 19.3203000000 23.2840000000 15.1407000000 +H 17.7736000000 23.2487000000 14.2139000000 +H 20.6688000000 22.9404000000 13.1368000000 +H 19.3206000000 21.9967000000 12.6290000000 +H 17.9336000000 26.6743000000 15.2578000000 +H 17.2809000000 25.0049000000 15.6563000000 +H 18.8888000000 25.6673000000 16.2392000000 +H 20.2120000000 23.8228000000 9.8330400000 +H 20.2640000000 22.3225000000 10.6346000000 +H 18.7257000000 23.1022000000 10.1481000000 +N 20.2162000000 26.7316000000 8.3770500000 +S 18.6873000000 27.1307000000 8.2088200000 +O 17.8672000000 25.9911000000 7.7771100000 +O 18.2706000000 28.0979000000 9.1744700000 +C 18.8956000000 28.1887000000 6.7701200000 +F 19.7577000000 29.1962000000 6.9324100000 +F 17.7310000000 28.7140000000 6.3919100000 +F 19.3086000000 27.5284000000 5.6686200000 +S 21.1273000000 26.7577000000 9.5846300000 +O 22.4136000000 26.0641000000 9.3756100000 +O 20.4705000000 26.4879000000 10.8802000000 +C 21.6368000000 28.4826000000 9.6843700000 +F 22.5850000000 28.7520000000 10.6595000000 +F 22.1471000000 28.8711000000 8.5369600000 +F 20.6016000000 29.2541000000 10.0173000000 N 15.6150000000 25.9266000000 10.2359000000 S 14.2397000000 25.8979000000 9.6453500000 O 14.0423000000 24.8222000000 8.6462300000 diff --git a/tests/structural/test_files/conf_2.xyz b/tests/structural/test_files/conf_2.xyz index af1d33f..28873ae 100644 --- a/tests/structural/test_files/conf_2.xyz +++ b/tests/structural/test_files/conf_2.xyz @@ -1,66 +1,66 @@ 64 -Mg 16.4220000000 0.9116820000 20.0830000000 -O 15.9737000000 0.8419110000 18.1814000000 -O 14.5475000000 1.1237600000 20.4561000000 -C 14.6972000000 1.4391100000 17.9561000000 -C 13.8491000000 0.9109220000 19.2133000000 -C 16.8396000000 1.1096100000 17.0624000000 -C 13.5800000000 1.0850700000 21.4472000000 -H 14.8147000000 2.4596200000 17.8487000000 -H 14.3227000000 1.0982900000 17.0190000000 -H 12.9080000000 1.4934200000 19.0799000000 -H 13.7312000000 -0.1615488362 19.0313000000 -H 17.8309000000 0.5923830000 17.2429000000 -H 16.2483000000 0.6569110000 16.1662000000 -H 17.1831000000 2.0939800000 16.8601000000 -H 13.3203000000 0.0559511638 21.7598000000 -H 13.8699000000 1.5381700000 22.3974000000 -H 12.6581000000 1.5282700000 21.0763000000 -O 18.3365000000 0.8227610000 19.5785000000 -O 16.7299000000 2.8185400000 19.8168000000 -C 19.0282000000 2.0790800000 19.4902000000 -C 18.0304000000 3.2508800000 19.3262000000 -C 19.2395000000 -0.2874488362 19.3079000000 -C 15.9721000000 4.0206500000 19.8398000000 -H 19.7214000000 2.1004400000 20.3049000000 -H 19.6947000000 2.1879900000 18.5592000000 -H 18.3804000000 4.1584100000 19.8684000000 -H 18.1121000000 3.4647100000 18.2848000000 -H 18.6298000000 -1.1845488362 19.3286000000 -H 19.7074000000 -0.2397488362 18.3378000000 -H 20.0074000000 -0.3518488362 20.0662000000 -H 14.9794000000 3.7366300000 19.9986000000 -H 16.2360000000 4.6288700000 20.7110000000 -H 15.9292000000 4.5685100000 18.9273000000 -O 16.0113000000 -0.9504488362 20.3516000000 -O 17.9753000000 -1.2012488362 22.4038000000 -C 15.6867000000 -1.5371488362 21.6606000000 -C 16.8621000000 -2.1085488362 22.4182000000 -C 15.9204000000 -1.9010488362 19.2931000000 -C 19.1345000000 -1.5529488362 23.1300000000 -H 15.3061000000 -0.8655488362 22.3910000000 -H 14.9062000000 -2.2874488362 21.5820000000 -H 16.6697000000 -2.2851488362 23.4434000000 -H 17.2085000000 -2.9671488362 21.8674000000 -H 16.4030000000 -1.5115488362 18.4545000000 -H 16.4422000000 -2.8599488362 19.4954000000 -H 14.8954000000 -2.1671488362 19.0153000000 -H 19.7049000000 -0.5905488362 23.2311000000 -H 18.9518000000 -1.9725488362 24.1318000000 -H 19.6721000000 -2.3212488362 22.5500000000 -N 18.7740000000 2.0509500000 23.3406000000 -S 19.7250000000 3.2093000000 23.6647000000 -O 19.7252000000 4.3642100000 22.8260000000 -O 19.9800000000 3.3838900000 25.0652000000 -C 21.2827000000 2.3140500000 23.1785000000 -F 22.3301000000 3.0803900000 23.0166000000 -F 21.2363000000 1.6509300000 22.0553000000 -F 21.6553000000 1.4635200000 24.1494000000 -S 17.2686000000 2.1614800000 23.1565000000 -O 16.8284000000 1.3434000000 22.0543000000 -O 16.7151000000 3.5015700000 23.1463000000 -C 16.5811000000 1.3684900000 24.7016000000 -F 16.9848000000 0.1102511638 24.6964000000 -F 17.0329000000 1.9076000000 25.7446000000 -F 15.2172000000 1.3822600000 24.7841000000 +Mg 44.1533000000 11.2631000000 27.9158000000 +O 44.9140000000 13.0766000000 28.0894000000 +O 45.4031000000 10.7809000000 29.4077000000 +C 45.9461000000 13.2036000000 29.0724000000 +C 46.4393000000 11.7876000000 29.5206000000 +C 44.5823000000 14.3007000000 27.4510000000 +C 45.8506000000 9.5423000000 30.0167000000 +H 46.7776000000 13.7773000000 28.7356000000 +H 45.4611000000 13.7523000000 29.8489000000 +H 47.2490000000 11.6013000000 28.8265000000 +H 46.8740000000 11.7231000000 30.5319000000 +H 43.8867000000 14.1118000000 26.6718000000 +H 44.2250000000 15.2030000000 28.0460000000 +H 45.5070000000 14.5809000000 26.9285000000 +H 46.1653000000 9.6010500000 31.0388000000 +H 45.0104000000 8.8568100000 30.1041000000 +H 46.6257000000 8.9213900000 29.5915000000 +O 43.5948000000 9.4404700000 27.4635000000 +O 45.4558000000 10.6737000000 26.6215000000 +C 44.4815000000 8.5065100000 26.9363000000 +C 45.7030000000 9.2903600000 26.3945000000 +C 42.3310000000 8.8691200000 27.7989000000 +C 46.3862000000 11.5293000000 25.8661000000 +H 44.7496000000 7.7045900000 27.6182000000 +H 43.9636000000 7.9715700000 26.0948000000 +H 46.6338000000 8.9922900000 26.8973000000 +H 45.9517000000 8.9503300000 25.4039000000 +H 42.4665000000 7.9969000000 28.4364000000 +H 41.6498000000 9.6157800000 28.2677000000 +H 41.9111000000 8.5154700000 26.9006000000 +H 46.5949000000 11.3687000000 24.7989000000 +H 46.0411000000 12.5944000000 25.9649000000 +H 47.2274000000 11.4764000000 26.5683000000 +O 44.4765000000 12.3996000000 31.7428000000 +O 42.8287000000 11.6698000000 29.4651000000 +C 43.1515000000 11.8716000000 31.9669000000 +C 42.6617000000 10.9861000000 30.7900000000 +C 45.0457000000 13.3281000000 32.6762000000 +C 42.0679000000 12.8878000000 29.3435000000 +H 42.9830000000 11.3591000000 32.8686000000 +H 42.4725000000 12.7196000000 32.0651000000 +H 43.2351000000 10.0394000000 30.9296000000 +H 41.6230000000 10.7970000000 30.8800000000 +H 44.9189000000 12.9875000000 33.6749000000 +H 46.0746000000 13.6855000000 32.4816000000 +H 44.3569000000 14.1782000000 32.7259000000 +H 41.0685000000 12.7401000000 29.7875000000 +H 42.6775000000 13.6346000000 29.8715000000 +H 41.9005000000 13.2699000000 28.3494000000 +N 41.7403000000 12.9594000000 24.4579000000 +S 41.7076000000 12.9655000000 22.8721000000 +O 42.3245000000 14.1430000000 22.3165000000 +O 42.0294000000 11.6501000000 22.3090000000 +C 39.9086000000 13.2417000000 22.5476000000 +F 39.4966000000 14.1263000000 23.4034000000 +F 39.2474000000 12.1195000000 22.7174000000 +F 39.5814000000 13.6553000000 21.3107000000 +S 41.8253000000 11.7068000000 25.4207000000 +O 42.8238000000 11.8555000000 26.4604000000 +O 41.6598000000 10.3345000000 24.9221000000 +C 40.1630000000 11.9697000000 26.3068000000 +F 40.2185000000 13.1090000000 27.0226000000 +F 39.1084000000 12.1111000000 25.5259000000 +F 39.8989000000 11.0318000000 27.2501000000 diff --git a/tests/structural/test_files/conf_3.xyz b/tests/structural/test_files/conf_3.xyz index df5ad01..2b37e0f 100644 --- a/tests/structural/test_files/conf_3.xyz +++ b/tests/structural/test_files/conf_3.xyz @@ -1,51 +1,51 @@ 49 -Mg 16.0512000000 1.5931300000 31.1602000000 -O 15.4585000000 0.6924490000 29.4950000000 -O 17.0717000000 2.6555300000 29.7685000000 -C 15.6791000000 1.4713500000 28.3180000000 -C 16.9937000000 2.1632600000 28.4344000000 -C 14.3407000000 -0.1875488362 29.1679000000 -C 18.2099000000 3.5158800000 29.9024000000 -H 15.6472000000 0.8610830000 27.4020000000 -H 14.9030000000 2.3171500000 28.2761000000 -H 17.8086000000 1.4355000000 28.1955000000 -H 16.9986000000 3.0011100000 27.7186000000 -H 14.5277000000 -1.0601488362 28.5413000000 -H 14.0628000000 -0.5485488362 30.1344000000 -H 13.5180000000 0.4523410000 28.9033000000 -H 18.1855000000 4.4177800000 29.2760000000 -H 18.2431000000 3.7684900000 30.9367000000 -H 19.1631000000 3.0211000000 29.8078000000 -O 14.6652000000 0.8028980000 32.2419000000 -O 14.6465000000 2.9780400000 31.1968000000 -C 13.3660000000 1.3465300000 32.4606000000 -C 13.2863000000 2.5106800000 31.4275000000 -C 14.8875000000 -0.2916488362 33.0830000000 -C 14.7030000000 4.2768200000 30.5265000000 -H 12.5978000000 0.5849310000 32.3381000000 -H 13.2541000000 1.7086900000 33.4664000000 -H 12.8931000000 2.1415200000 30.4599000000 -H 12.6099000000 3.2556200000 31.8917000000 -H 14.9585000000 -0.1350488362 34.1763000000 -H 14.0682000000 -0.9463488362 32.8439000000 -H 15.8006000000 -0.8671488362 32.8329000000 -H 14.3245000000 5.0247500000 31.2296000000 -H 15.6891000000 4.7055100000 30.2408000000 -H 14.0683000000 4.3643400000 29.7121000000 -O 16.9374000000 2.2837300000 32.7370000000 -O 17.3995000000 0.2131511638 31.3896000000 -C 17.9602000000 1.4161700000 33.3098000000 -C 18.4579000000 0.5296910000 32.1862000000 -C 16.9527000000 3.5379300000 33.3619000000 -C 17.7734000000 -0.8771488362 30.5547000000 -H 18.8538000000 1.8520400000 33.7938000000 -H 17.5680000000 0.6943190000 33.9892000000 -H 19.1987000000 1.0891100000 31.5887000000 -H 18.9782000000 -0.2919488362 32.6535000000 -H 16.5690000000 4.2319200000 32.6076000000 -H 16.3996000000 3.4683200000 34.2915000000 -H 17.9387000000 3.9845100000 33.4555000000 -H 16.9229000000 -1.1841488362 29.9200000000 -H 18.5043000000 -0.4537488362 29.8808000000 -H 18.1399000000 -1.7119488362 31.1578000000 +Mg 33.1120000000 4.2323200000 2.2491500000 +O 34.1615000000 2.7912200000 2.9646400000 +O 34.8611000000 4.9289000000 1.7248500000 +C 35.5603000000 3.0584600000 3.1370500000 +C 36.0211000000 4.1460100000 2.2383300000 +C 33.9138000000 1.4077600000 3.3619300000 +C 35.2372000000 6.1603300000 1.1073800000 +H 35.6691000000 3.4461400000 4.1189800000 +H 36.3051000000 2.2891300000 3.0678400000 +H 36.8321000000 4.6713400000 2.8057100000 +H 36.5251000000 3.7097900000 1.3617800000 +H 32.7861000000 1.2310200000 3.2944100000 +H 34.4163000000 0.7092130000 2.6511600000 +H 34.3385000000 1.2220300000 4.3180200000 +H 35.7590000000 6.0376300000 0.1141511638 +H 34.3309000000 6.7776200000 0.8716970000 +H 35.8320000000 6.7834000000 1.7629500000 +O 31.5862000000 3.2845000000 2.9971500000 +O 33.2992000000 4.8062900000 4.0878200000 +C 31.1414000000 3.7743000000 4.2450400000 +C 32.3788000000 4.2098900000 4.9725100000 +C 30.5655000000 2.5024900000 2.4270800000 +C 34.1029000000 5.6210000000 4.8996900000 +H 30.5292000000 4.6958200000 4.0054300000 +H 30.6006000000 2.9926800000 4.8247100000 +H 32.0897000000 4.9191200000 5.7820600000 +H 32.9952000000 3.5315100000 5.5202100000 +H 31.0017000000 2.0355900000 1.6054300000 +H 30.1480000000 1.6629700000 3.0737900000 +H 29.7394000000 3.1708000000 2.1731400000 +H 34.8135000000 6.1114300000 4.2399400000 +H 33.5479000000 6.4841000000 5.3744800000 +H 34.5600000000 5.0801300000 5.6979200000 +O 31.9839000000 5.6917000000 1.6769400000 +O 33.0928000000 3.6272500000 0.5281950000 +C 31.5914000000 5.5534600000 0.3098511638 +C 31.9936000000 4.1946100000 -0.2636488362 +C 31.2781000000 6.9172100000 2.1660300000 +C 33.5887000000 2.4013900000 -0.0261488362 +H 30.4343000000 5.6881300000 0.2119511638 +H 31.9258000000 6.4138400000 -0.2448488362 +H 31.1970000000 3.4313300000 -0.2780488362 +H 32.2803000000 4.3814700000 -1.2868488362 +H 31.6456000000 7.7908000000 1.5803300000 +H 30.1445000000 6.8524100000 2.1076400000 +H 31.5725000000 7.1273800000 3.2498900000 +H 34.0590000000 2.5564200000 -0.9688488362 +H 34.2926000000 1.8100000000 0.5640770000 +H 32.8462000000 1.6155400000 -0.1894488362 diff --git a/tests/structural/test_files/top_conf.csv b/tests/structural/test_files/top_conf.csv index f6eb6e9..9b414c3 100644 --- a/tests/structural/test_files/top_conf.csv +++ b/tests/structural/test_files/top_conf.csv @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ac7a24762d67a0317a3e51575b5eea3ef2ae0915967244efa175aa6052ca25ff +oid sha256:c6047dcb0d1025b33db3811a0e976daa6b70725faec7c23299c9ad919b5dccd0 size 358