@@ -685,7 +685,7 @@ def _evaluate_ce(
685
685
additional_condition = 0 ,
686
686
perc_strength_ICOHP = 0.15 ,
687
687
adapt_extremum_to_add_cond = False ,
688
- ):
688
+ ) -> None :
689
689
"""
690
690
Args:
691
691
lowerlimit: lower limit which determines the ICOHPs that are considered for the determination of the
@@ -698,8 +698,6 @@ def _evaluate_ce(
698
698
that are still considered for the evaluation
699
699
adapt_extremum_to_add_cond: will recalculate the limit based on the bonding type and not on the overall
700
700
extremum.
701
-
702
- Returns:
703
701
"""
704
702
# get extremum
705
703
if lowerlimit is None and upperlimit is None :
@@ -812,6 +810,7 @@ def _find_environments(self, additional_condition, lowerlimit, upperlimit, only_
812
810
only_bonds_to (list): list of str, e.g. ["O"] that will ensure that only bonds to "O" will be considered
813
811
814
812
Returns:
813
+ tuple: list of icohps, list of keys, list of lengths, list of neighisite, list of neighsite, list of coords
815
814
"""
816
815
# run over structure
817
816
list_neighsite = []
@@ -829,12 +828,8 @@ def _find_environments(self, additional_condition, lowerlimit, upperlimit, only_
829
828
only_bonds_to = only_bonds_to ,
830
829
)
831
830
832
- (
833
- keys_from_ICOHPs ,
834
- lengths_from_ICOHPs ,
835
- neighbors_from_ICOHPs ,
836
- selected_ICOHPs ,
837
- ) = self ._find_relevant_atoms_additional_condition (idx , icohps , additional_condition )
831
+ additional_conds = self ._find_relevant_atoms_additional_condition (idx , icohps , additional_condition )
832
+ keys_from_ICOHPs , lengths_from_ICOHPs , neighbors_from_ICOHPs , selected_ICOHPs = additional_conds
838
833
839
834
if len (neighbors_from_ICOHPs ) > 0 :
840
835
centralsite = self .structure [idx ]
@@ -927,6 +922,7 @@ def _find_relevant_atoms_additional_condition(self, isite, icohps, additional_co
927
922
additional_condition (int): additional condition
928
923
929
924
Returns:
925
+ tuple: keys, lengths and neighbors from selected ICOHPs and selected ICOHPs
930
926
"""
931
927
neighbors_from_ICOHPs = []
932
928
lengths_from_ICOHPs = []
@@ -1048,17 +1044,11 @@ def _find_relevant_atoms_additional_condition(self, isite, icohps, additional_co
1048
1044
icohps_from_ICOHPs .append (icohp .summed_icohp )
1049
1045
keys_from_ICOHPs .append (key )
1050
1046
1051
- return (
1052
- keys_from_ICOHPs ,
1053
- lengths_from_ICOHPs ,
1054
- neighbors_from_ICOHPs ,
1055
- icohps_from_ICOHPs ,
1056
- )
1047
+ return keys_from_ICOHPs , lengths_from_ICOHPs , neighbors_from_ICOHPs , icohps_from_ICOHPs
1057
1048
1058
1049
@staticmethod
1059
1050
def _get_icohps (icohpcollection , isite , lowerlimit , upperlimit , only_bonds_to ):
1060
- """
1061
- Return icohp dict for certain site.
1051
+ """Return icohp dict for certain site.
1062
1052
1063
1053
Args:
1064
1054
icohpcollection: Icohpcollection object
@@ -1068,6 +1058,7 @@ def _get_icohps(icohpcollection, isite, lowerlimit, upperlimit, only_bonds_to):
1068
1058
only_bonds_to (list): list of str, e.g. ["O"] that will ensure that only bonds to "O" will be considered
1069
1059
1070
1060
Returns:
1061
+ dict: of IcohpValues. The keys correspond to the values from the initial list_labels.
1071
1062
"""
1072
1063
return icohpcollection .get_icohp_dict_of_site (
1073
1064
site = isite ,
@@ -1091,7 +1082,7 @@ def _get_atomnumber(atomstring) -> int:
1091
1082
return int (LobsterNeighbors ._split_string (atomstring )[1 ]) - 1
1092
1083
1093
1084
@staticmethod
1094
- def _split_string (s ):
1085
+ def _split_string (s ) -> tuple [ str , str ] :
1095
1086
"""
1096
1087
Will split strings such as "Na1" in "Na" and "1" and return "1".
1097
1088
@@ -1140,7 +1131,7 @@ def _get_limit_from_extremum(
1140
1131
):
1141
1132
"""
1142
1133
Return limits for the evaluation of the icohp values from an icohpcollection
1143
- Return -float(' inf' ), min(max_icohp*0.15,-0.1). Currently only works for ICOHPs.
1134
+ Return -float(" inf" ), min(max_icohp*0.15,-0.1). Currently only works for ICOHPs.
1144
1135
1145
1136
Args:
1146
1137
icohpcollection: icohpcollection object
@@ -1390,10 +1381,10 @@ class ICOHPNeighborsInfo(NamedTuple):
1390
1381
total_icohp (float): sum of icohp values of neighbors to the selected sites [given by the id in structure]
1391
1382
list_icohps (list): list of summed icohp values for all identified interactions with neighbors
1392
1383
n_bonds (int): number of identified bonds to the selected sites
1393
- labels (list( str) ): labels (from ICOHPLIST) for all identified bonds
1394
- atoms (list( list( str) ): list of list describing the species present in the identified interactions
1395
- (names from ICOHPLIST), e.g., [' Ag3', 'O5' ]
1396
- central_isites (list( int) ): list of the central isite for each identified interaction.
1384
+ labels (list[ str] ): labels (from ICOHPLIST) for all identified bonds
1385
+ atoms (list[ list[ str]] ): list of list describing the species present in the identified interactions
1386
+ (names from ICOHPLIST), e.g., [" Ag3", "O5" ]
1387
+ central_isites (list[ int] ): list of the central isite for each identified interaction.
1397
1388
1398
1389
1399
1390
"""
0 commit comments