@@ -590,16 +590,16 @@ def _get_mask(self, struct1, struct2, fu, s1_supercell):
590
590
591
591
def fit (
592
592
self ,
593
- struct1 : Structure ,
594
- struct2 : Structure ,
593
+ struct1 : Structure | IStructure ,
594
+ struct2 : Structure | IStructure ,
595
595
symmetric : bool = False ,
596
596
skip_structure_reduction : bool = False ,
597
597
) -> bool :
598
598
"""Fit two structures.
599
599
600
600
Args:
601
- struct1 (Structure): 1st structure
602
- struct2 (Structure): 2nd structure
601
+ struct1 (Structure | IStructure ): 1st structure
602
+ struct2 (Structure | IStructure ): 2nd structure
603
603
symmetric (bool): Defaults to False
604
604
If True, check the equality both ways.
605
605
This only impacts a small percentage of structures
@@ -984,7 +984,9 @@ def _get_reduced_istructure(
984
984
return reduced
985
985
986
986
@classmethod
987
- def _get_reduced_structure (cls , struct : Structure , primitive_cell : bool = True , niggli : bool = True ) -> Structure :
987
+ def _get_reduced_structure (
988
+ cls , struct : Structure | IStructure , primitive_cell : bool = True , niggli : bool = True
989
+ ) -> Structure :
988
990
"""Helper method to find a reduced structure."""
989
991
return Structure .from_sites (
990
992
cls ._get_reduced_istructure (SiteOrderedIStructure .from_sites (struct ), primitive_cell , niggli )
@@ -1015,7 +1017,9 @@ def get_rms_anonymous(self, struct1, struct2):
1015
1017
1016
1018
return None , None
1017
1019
1018
- def get_best_electronegativity_anonymous_mapping (self , struct1 : Structure , struct2 : Structure ) -> dict | None :
1020
+ def get_best_electronegativity_anonymous_mapping (
1021
+ self , struct1 : Structure | IStructure , struct2 : Structure | IStructure
1022
+ ) -> dict | None :
1019
1023
"""
1020
1024
Performs an anonymous fitting, which allows distinct species in one
1021
1025
structure to map to another. e.g. to compare if the Li2O and Na2O
@@ -1075,8 +1079,8 @@ def get_all_anonymous_mappings(self, struct1, struct2, niggli=True, include_dist
1075
1079
1076
1080
def fit_anonymous (
1077
1081
self ,
1078
- struct1 : Structure ,
1079
- struct2 : Structure ,
1082
+ struct1 : Structure | IStructure ,
1083
+ struct2 : Structure | IStructure ,
1080
1084
niggli : bool = True ,
1081
1085
skip_structure_reduction : bool = False ,
1082
1086
) -> bool :
0 commit comments