1- from typing import Optional , Union , Dict , List , Tuple , Literal
1+ from typing import Optional , Union , Literal
22
33import numpy as np
44
77from . import Rotation
88
99
10- _kinematics : Dict [BravaisLattice , Dict [CrystalKinematics , List [np .ndarray ]]] = {
10+ _kinematics : dict [BravaisLattice , dict [CrystalKinematics , list [np .ndarray ]]] = {
1111 'cF' : {
1212 'slip' : [np .array ([
1313 [ 0 ,+ 1 ,- 1 , + 1 ,+ 1 ,+ 1 ],
244244}
245245
246246
247- lattice_symmetries : Dict [Optional [BravaisLattice ], CrystalFamily ] = {
247+ lattice_symmetries : dict [Optional [BravaisLattice ], CrystalFamily ] = {
248248 'aP' : 'triclinic' ,
249249
250250 'mP' : 'monoclinic' ,
265265 'cF' : 'cubic' ,
266266 }
267267
268- orientation_relationships : Dict [str , Dict [str ,List [np .ndarray ]]] = {
268+ orientation_relationships : dict [str , dict [str ,list [np .ndarray ]]] = {
269269 'KS' : { # https://doi.org/10.1016/j.jallcom.2012.02.004
270270 'cF-->cI' : [
271271 np .repeat (np .array ([
@@ -800,17 +800,17 @@ def __eq__(self,
800800 self .family == other .family )
801801
802802 @property
803- def parameters (self ) -> Optional [Dict ]:
803+ def parameters (self ) -> Optional [dict ]:
804804 """Return lattice parameters a, b, c, alpha, beta, gamma."""
805805 has_parameters = all ([hasattr (self ,p ) for p in ['a' ,'b' ,'c' ,'alpha' ,'beta' ,'gamma' ]])
806806 return dict (a = self .a ,b = self .b ,c = self .c ,
807807 alpha = self .alpha ,beta = self .beta ,gamma = self .gamma ) if has_parameters else None
808808
809809 @property
810- def immutable (self ) -> Dict [str , float ]:
810+ def immutable (self ) -> dict [str , float ]:
811811 """Return immutable lattice parameters."""
812812 # ToDo: use pattern matching in Python 3.10
813- _immutable : Dict [CrystalFamily , Dict [str ,float ]] = {
813+ _immutable : dict [CrystalFamily , dict [str ,float ]] = {
814814 'cubic' : {
815815 'b' : 1.0 ,
816816 'c' : 1.0 ,
@@ -845,13 +845,13 @@ def immutable(self) -> Dict[str, float]:
845845
846846
847847 @property
848- def orientation_relationships (self ) -> List [str ]:
848+ def orientation_relationships (self ) -> list [str ]:
849849 """Return labels of orientation relationships."""
850850 return [k for k ,v in orientation_relationships .items () if np .any ([m .startswith (str (self .lattice )) for m in v ])]
851851
852852
853853 @property
854- def standard_triangle (self ) -> Union [Dict [str , np .ndarray ], None ]:
854+ def standard_triangle (self ) -> Union [dict [str , np .ndarray ], None ]:
855855 """
856856 Corners of the standard triangle.
857857
@@ -878,7 +878,7 @@ def standard_triangle(self) -> Union[Dict[str, np.ndarray], None]:
878878 ... [0.,1.,0.]]).T), # blue
879879 ... }
880880 """
881- _basis : Dict [CrystalFamily , Dict [str , np .ndarray ]] = {
881+ _basis : dict [CrystalFamily , dict [str , np .ndarray ]] = {
882882 'cubic' : {'improper' :np .array ([ [- 1. , 0. , 1. ],
883883 [ np .sqrt (2. ) , - np .sqrt (2. ) , 0. ],
884884 [ 0. , np .sqrt (3. ) , 0. ] ]),
@@ -944,7 +944,7 @@ def symmetry_operations(self) -> Rotation:
944944
945945 https://en.wikipedia.org/wiki/Crystal_system#Crystal_classes
946946 """
947- _symmetry_operations : Dict [CrystalFamily , List ] = {
947+ _symmetry_operations : dict [CrystalFamily , list ] = {
948948 'cubic' : [
949949 [ 1.0 , 0.0 , 0.0 , 0.0 ],
950950 [ 0.0 , 1.0 , 0.0 , 0.0 ],
@@ -1058,7 +1058,7 @@ def basis_reciprocal(self) -> np.ndarray:
10581058 @property
10591059 def lattice_points (self ) -> np .ndarray :
10601060 """Return lattice points."""
1061- _lattice_points : Dict [str , List ] = {
1061+ _lattice_points : dict [str , list ] = {
10621062 'P' : [
10631063 ],
10641064 'S' : [
@@ -1152,7 +1152,7 @@ def to_frame(self, *,
11521152
11531153
11541154 def kinematics (self ,
1155- mode : CrystalKinematics ) -> Dict [str , List [np .ndarray ]]:
1155+ mode : CrystalKinematics ) -> dict [str , list [np .ndarray ]]:
11561156 """
11571157 Return crystal kinematics systems.
11581158
@@ -1189,7 +1189,7 @@ def kinematics(self,
11891189
11901190
11911191 def characteristic_shear_twin (self ,
1192- N_twin : Union [List [int ], Literal ['*' ]] = '*' ) -> np .ndarray :
1192+ N_twin : Union [list [int ], Literal ['*' ]] = '*' ) -> np .ndarray :
11931193 """
11941194 Return characteristic shear for twinning.
11951195
@@ -1229,7 +1229,7 @@ def characteristic_shear_twin(self,
12291229
12301230 def relation_operations (self ,
12311231 model : str ,
1232- target = None ) -> Tuple [BravaisLattice , Rotation ]:
1232+ target = None ) -> tuple [BravaisLattice , Rotation ]:
12331233 """
12341234 Crystallographic orientation relationships for phase transformations.
12351235
0 commit comments