File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -600,6 +600,7 @@ def sites_lists_from_molecules(molecules: list[Molecule]) -> list[list[PeriodicS
600600 for site in candidate_equiv_mol .sites
601601 ],
602602 frac_tol = frac_tol ,
603+ same_image = True ,
603604 )
604605 for other_equiv_mol in [* equiv_complex_molecules , * unique_candidate_equiv_molecules ]
605606 ):
Original file line number Diff line number Diff line change @@ -399,7 +399,7 @@ def get_defect_type_and_composition_diff(
399399 defect_type = "interstitial"
400400 elif len (composition_diff ) == 1 and next (iter (composition_diff .values ())) == - 1 :
401401 defect_type = "vacancy"
402- elif len (composition_diff ) == 2 :
402+ elif len (composition_diff ) == 2 and all ( i in composition_diff . values () for i in [ - 1 , 1 ]) :
403403 defect_type = "substitution"
404404 else :
405405 defect_type = "complex"
@@ -516,9 +516,12 @@ def get_defect_type_and_site_indices(
516516 defect_species_coords , defect_species_indices = get_coords_and_idx_of_species (
517517 defect_supercell , elt_symbol , use_oxi_states = use_oxi_states
518518 )
519- species_distances = distance_matrix [bulk_species_indices ]
520- species_min_dist = max (species_distances [np .nonzero (species_distances )].min (), 1 )
521- site_dist_tol = site_tol if site_tol is None or abs_tol else site_tol * species_min_dist
519+ if bulk_species_indices .size == 0 : # extrinsic species
520+ site_dist_tol = None
521+ else :
522+ species_distances = distance_matrix [bulk_species_indices ]
523+ species_min_dist = max (species_distances [np .nonzero (species_distances )].min (), 1 )
524+ site_dist_tol = site_tol if site_tol is None or abs_tol else site_tol * species_min_dist
522525
523526 site_mapping = _get_site_mapping_from_coords_and_indices (
524527 bulk_species_coords ,
You can’t perform that action at this time.
0 commit comments