@@ -127,7 +127,7 @@ def __init__(
127127 filename_blist_sg2 (PathLike): Path to additional ICOOP, ICOBI data for structure graphs.
128128 id_blist_sg1 ("icoop" | "icobi"): Identity of data in filename_blist_sg1.
129129 id_blist_sg2 ("icoop" | "icobi"): Identity of data in filename_blist_sg2.
130- backward_compatibility (bool): compatiblity with neighbor detection prior 2025 (less strict).
130+ backward_compatibility (bool): compatibility with neighbor detection prior 2025 (less strict).
131131 """
132132 if filename_icohp is not None :
133133 self .ICOHP = Icohplist (are_coops = are_coops , are_cobis = are_cobis , filename = filename_icohp )
@@ -1065,7 +1065,7 @@ def _find_relevant_atoms_additional_condition(
10651065 site_idx : int ,
10661066 icohps : dict [str , IcohpValue ],
10671067 additional_condition : Literal [0 , 1 , 2 , 3 , 4 , 5 , 6 ],
1068- ) -> tuple [list [str ], list [float ], list [int ], list [float ]]:
1068+ ) -> tuple [list [str ], list [float ], list [int ], list [float ], list [ tuple [ float , float , float ]] ]:
10691069 """Find all relevant atoms that fulfill the additional condition.
10701070
10711071 Args:
@@ -1079,8 +1079,8 @@ def _find_relevant_atoms_additional_condition(
10791079 keys_from_ICOHPs : list [str ] = []
10801080 lengths_from_ICOHPs : list [float ] = []
10811081 neighbors_from_ICOHPs : list [int ] = []
1082- icohps_from_ICOHPs : list [IcohpValue ] = []
1083- translation_from_ICOHPs : list [list [ int , int , int ]] = []
1082+ icohps_from_ICOHPs : list [float ] = []
1083+ translation_from_ICOHPs : list [tuple [ float , float , float ]] = []
10841084
10851085 for key , icohp in icohps .items ():
10861086 atomnr1 = self ._get_atomnumber (icohp ._atom1 )
@@ -1582,15 +1582,18 @@ class ICOHPNeighborsInfo(NamedTuple):
15821582def check_ICOHPs (lengths_from_ICOHPs , selected_ICOHPs , translation , length_threshold = 0.01 , energy_threshold = 0.1 ):
15831583 for i in range (len (lengths_from_ICOHPs )):
15841584 for j in range (i + 1 , len (lengths_from_ICOHPs )):
1585- if abs (lengths_from_ICOHPs [i ] - lengths_from_ICOHPs [j ]) < length_threshold :
1586- if abs (selected_ICOHPs [i ] - selected_ICOHPs [j ]) > energy_threshold and (
1585+ if (
1586+ abs (lengths_from_ICOHPs [i ] - lengths_from_ICOHPs [j ]) < length_threshold
1587+ and abs (selected_ICOHPs [i ] - selected_ICOHPs [j ]) > energy_threshold
1588+ and (
15871589 translation [i ][0 ] == - translation [j ][0 ]
15881590 and translation [i ][1 ] == - translation [j ][1 ]
15891591 and translation [i ][2 ] == - translation [j ][2 ]
1590- ):
1591- warnings .warn (
1592- f"Lengths { lengths_from_ICOHPs [i ]} and { lengths_from_ICOHPs [j ]} are very close "
1593- f"and translation exactly opposite, but corresponding ICOHPs { selected_ICOHPs [i ]} "
1594- f"and { selected_ICOHPs [j ]} are not. Our neighbor detection might fail." ,
1595- stacklevel = 2 ,
1596- )
1592+ )
1593+ ):
1594+ warnings .warn (
1595+ f"Lengths { lengths_from_ICOHPs [i ]} and { lengths_from_ICOHPs [j ]} are very close "
1596+ f"and translation exactly opposite, but corresponding ICOHPs { selected_ICOHPs [i ]} "
1597+ f"and { selected_ICOHPs [j ]} are not. Our neighbor detection might fail." ,
1598+ stacklevel = 2 ,
1599+ )
0 commit comments