@@ -895,7 +895,6 @@ def get_num_implicit_hydrogens(sym):
895
895
896
896
coord_to_species = {}
897
897
coord_to_magmoms = {}
898
- labels = {}
899
898
900
899
def get_matching_coord (coord ):
901
900
keys = list (coord_to_species )
@@ -909,15 +908,15 @@ def get_matching_coord(coord):
909
908
return keys [inds [0 ]]
910
909
return False
911
910
912
- for i , label in enumerate ( data ["_atom_site_label" ]):
911
+ for i in range ( len ( data ["_atom_site_label" ]) ):
913
912
try :
914
913
# If site type symbol exists, use it. Otherwise, we use the
915
914
# label.
916
915
symbol = self ._parse_symbol (data ["_atom_site_type_symbol" ][i ])
917
916
num_h = get_num_implicit_hydrogens (data ["_atom_site_type_symbol" ][i ])
918
917
except KeyError :
919
- symbol = self ._parse_symbol (label )
920
- num_h = get_num_implicit_hydrogens (label )
918
+ symbol = self ._parse_symbol (data [ "_atom_site_label" ][ i ] )
919
+ num_h = get_num_implicit_hydrogens (data [ "_atom_site_label" ][ i ] )
921
920
if not symbol :
922
921
continue
923
922
@@ -937,7 +936,7 @@ def get_matching_coord(coord):
937
936
x = str2float (data ["_atom_site_fract_x" ][i ])
938
937
y = str2float (data ["_atom_site_fract_y" ][i ])
939
938
z = str2float (data ["_atom_site_fract_z" ][i ])
940
- magmom = magmoms .get (label , np .array ([0 , 0 , 0 ]))
939
+ magmom = magmoms .get (data [ "_atom_site_label" ][ i ] , np .array ([0 , 0 , 0 ]))
941
940
942
941
try :
943
942
occu = str2float (data ["_atom_site_occupancy" ][i ])
@@ -956,16 +955,13 @@ def get_matching_coord(coord):
956
955
"in calculations unless hydrogens added."
957
956
)
958
957
comp = Composition (comp_d )
959
-
960
958
if not match :
961
959
coord_to_species [coord ] = comp
962
960
coord_to_magmoms [coord ] = magmom
963
- labels [coord ] = label
964
961
else :
965
962
coord_to_species [match ] += comp
966
963
# disordered magnetic not currently supported
967
964
coord_to_magmoms [match ] = None
968
- labels [match ] = label
969
965
970
966
sum_occu = [
971
967
sum (c .values ()) for c in coord_to_species .values () if set (c .elements ) != {Element ("O" ), Element ("H" )}
@@ -984,7 +980,6 @@ def get_matching_coord(coord):
984
980
all_magmoms = []
985
981
all_hydrogens = []
986
982
equivalent_indices = []
987
- all_labels = []
988
983
989
984
# check to see if magCIF file is disordered
990
985
if self .feature_flags ["magcif" ]:
@@ -1035,7 +1030,6 @@ def get_matching_coord(coord):
1035
1030
all_coords .extend (coords )
1036
1031
all_species .extend (len (coords ) * [species ])
1037
1032
all_magmoms .extend (magmoms )
1038
- all_labels .extend (len (coords ) * [labels [tmp_coords [0 ]]])
1039
1033
1040
1034
# rescale occupancies if necessary
1041
1035
for i , species in enumerate (all_species ):
@@ -1052,10 +1046,6 @@ def get_matching_coord(coord):
1052
1046
if self .feature_flags ["magcif" ]:
1053
1047
site_properties ["magmom" ] = all_magmoms
1054
1048
1055
- if any (all_labels ):
1056
- assert len (all_labels ) == len (all_species )
1057
- site_properties ["labels" ] = all_labels
1058
-
1059
1049
if len (site_properties ) == 0 :
1060
1050
site_properties = None
1061
1051
0 commit comments