@@ -689,7 +689,7 @@ def zeroed(self, tol: float = 1e-3):
689
689
Returns:
690
690
TensorCollection where small values are set to 0.
691
691
"""
692
- return self .__class__ ([t .zeroed (tol ) for t in self ])
692
+ return self .__class__ ([tensor .zeroed (tol ) for tensor in self ])
693
693
694
694
def transform (self , symm_op ):
695
695
"""Transforms TensorCollection with a symmetry operation.
@@ -699,7 +699,7 @@ def transform(self, symm_op):
699
699
Returns:
700
700
TensorCollection.
701
701
"""
702
- return self .__class__ ([t .transform (symm_op ) for t in self ])
702
+ return self .__class__ ([tensor .transform (symm_op ) for tensor in self ])
703
703
704
704
def rotate (self , matrix , tol : float = 1e-3 ):
705
705
"""Rotates TensorCollection.
@@ -710,20 +710,20 @@ def rotate(self, matrix, tol: float = 1e-3):
710
710
Returns:
711
711
TensorCollection.
712
712
"""
713
- return self .__class__ ([t .rotate (matrix , tol ) for t in self ])
713
+ return self .__class__ ([tensor .rotate (matrix , tol ) for tensor in self ])
714
714
715
715
@property
716
716
def symmetrized (self ):
717
717
"""TensorCollection where all tensors are symmetrized."""
718
- return self .__class__ ([t .symmetrized for t in self ])
718
+ return self .__class__ ([tensor .symmetrized for tensor in self ])
719
719
720
720
def is_symmetric (self , tol : float = 1e-5 ):
721
721
""":param tol: tolerance
722
722
723
723
Returns:
724
724
Whether all tensors are symmetric.
725
725
"""
726
- return all (t .is_symmetric (tol ) for t in self )
726
+ return all (tensor .is_symmetric (tol ) for tensor in self )
727
727
728
728
def fit_to_structure (self , structure : Structure , symprec : float = 0.1 ):
729
729
"""Fits all tensors to a Structure.
@@ -734,7 +734,7 @@ def fit_to_structure(self, structure: Structure, symprec: float = 0.1):
734
734
Returns:
735
735
TensorCollection.
736
736
"""
737
- return self .__class__ ([t .fit_to_structure (structure , symprec ) for t in self ])
737
+ return self .__class__ ([tensor .fit_to_structure (structure , symprec ) for tensor in self ])
738
738
739
739
def is_fit_to_structure (self , structure : Structure , tol : float = 1e-2 ):
740
740
""":param structure: Structure
@@ -743,25 +743,25 @@ def is_fit_to_structure(self, structure: Structure, tol: float = 1e-2):
743
743
Returns:
744
744
Whether all tensors are fitted to Structure.
745
745
"""
746
- return all (t .is_fit_to_structure (structure , tol ) for t in self )
746
+ return all (tensor .is_fit_to_structure (structure , tol ) for tensor in self )
747
747
748
748
@property
749
749
def voigt (self ):
750
750
"""TensorCollection where all tensors are in Voigt form."""
751
- return [t .voigt for t in self ]
751
+ return [tensor .voigt for tensor in self ]
752
752
753
753
@property
754
754
def ranks (self ):
755
755
"""Ranks for all tensors."""
756
- return [t .rank for t in self ]
756
+ return [tensor .rank for tensor in self ]
757
757
758
758
def is_voigt_symmetric (self , tol : float = 1e-6 ):
759
759
""":param tol: tolerance
760
760
761
761
Returns:
762
762
Whether all tensors are voigt symmetric.
763
763
"""
764
- return all (t .is_voigt_symmetric (tol ) for t in self )
764
+ return all (tensor .is_voigt_symmetric (tol ) for tensor in self )
765
765
766
766
@classmethod
767
767
def from_voigt (cls , voigt_input_list , base_class = Tensor ):
@@ -785,7 +785,7 @@ def convert_to_ieee(self, structure: Structure, initial_fit=True, refine_rotatio
785
785
Returns:
786
786
TensorCollection.
787
787
"""
788
- return self .__class__ ([t .convert_to_ieee (structure , initial_fit , refine_rotation ) for t in self ])
788
+ return self .__class__ ([tensor .convert_to_ieee (structure , initial_fit , refine_rotation ) for tensor in self ])
789
789
790
790
def round (self , * args , ** kwargs ):
791
791
"""Round all tensors.
@@ -796,12 +796,12 @@ def round(self, *args, **kwargs):
796
796
Returns:
797
797
TensorCollection.
798
798
"""
799
- return self .__class__ ([t .round (* args , ** kwargs ) for t in self ])
799
+ return self .__class__ ([tensor .round (* args , ** kwargs ) for tensor in self ])
800
800
801
801
@property
802
802
def voigt_symmetrized (self ):
803
803
"""TensorCollection where all tensors are voigt symmetrized."""
804
- return self .__class__ ([t .voigt_symmetrized for t in self ])
804
+ return self .__class__ ([tensor .voigt_symmetrized for tensor in self ])
805
805
806
806
def as_dict (self , voigt = False ):
807
807
""":param voigt: Whether to use Voigt form.
@@ -813,7 +813,7 @@ def as_dict(self, voigt=False):
813
813
dct = {
814
814
"@module" : type (self ).__module__ ,
815
815
"@class" : type (self ).__name__ ,
816
- "tensor_list" : [t .tolist () for t in tensor_list ],
816
+ "tensor_list" : [tensor .tolist () for tensor in tensor_list ],
817
817
}
818
818
if voigt :
819
819
dct ["voigt" ] = voigt
0 commit comments