Skip to content

Commit afb7691

Browse files
add fixed-schema replicas of pymatgen objects, revert xas doc change for separate pr
1 parent b53352d commit afb7691

File tree

4 files changed

+525
-13
lines changed

4 files changed

+525
-13
lines changed

emmet-builders/emmet/builders/materials/corrected_entries.py

-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ def process_item(self, item):
143143
self.logger.debug(f"Processing {len(entries)} entries for {chemsys}")
144144

145145
all_entry_types = {str(e.data["run_type"]) for e in entries}
146-
147146
corrected_entries = {}
148147

149148
for compatibility in self.compatibility:

emmet-core/emmet/core/math.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
from typing import Tuple, List
1+
"""Define types used for array-like data."""
2+
from typing import TypeVar
23

3-
Vector3D = Tuple[float, float, float]
4+
Vector3D = TypeVar("Vector3D", bound=tuple[float, float, float])
45
Vector3D.__doc__ = "Real space vector" # type: ignore
56

6-
Matrix3D = Tuple[Vector3D, Vector3D, Vector3D]
7+
Matrix3D = TypeVar("Matrix3D", bound = tuple[Vector3D, Vector3D, Vector3D])
78
Matrix3D.__doc__ = "Real space Matrix" # type: ignore
89

9-
Vector6D = Tuple[float, float, float, float, float, float]
10+
Vector6D = TypeVar("Vector6D", bound=tuple[float, float, float, float, float, float])
1011
Vector6D.__doc__ = "6D Voigt matrix component" # type: ignore
1112

12-
MatrixVoigt = Tuple[Vector6D, Vector6D, Vector6D, Vector6D, Vector6D, Vector6D]
13-
Vector6D.__doc__ = "Voigt representation of a 3x3x3x3 tensor" # type: ignore
13+
MatrixVoigt = TypeVar("MatrixVoigt",bound=tuple[Vector6D, Vector6D, Vector6D, Vector6D, Vector6D, Vector6D])
14+
MatrixVoigt.__doc__ = "Voigt representation of a 3x3x3x3 tensor" # type: ignore
1415

15-
Tensor3R = List[List[List[float]]]
16+
Tensor3R = TypeVar("Tensor3R",bound=list[list[list[float]]])
1617
Tensor3R.__doc__ = "Generic tensor of rank 3" # type: ignore
1718

18-
Tensor4R = List[List[List[List[float]]]]
19+
Tensor4R = TypeVar("Tensor4R",bound=list[list[list[list[float]]]])
1920
Tensor4R.__doc__ = "Generic tensor of rank 4" # type: ignore
2021

21-
ListVector3D = List[float]
22+
ListVector3D = TypeVar("ListVector3D",bound=list[float])
2223
ListVector3D.__doc__ = "Real space vector as list" # type: ignore
2324

24-
ListMatrix3D = List[ListVector3D]
25+
ListMatrix3D = TypeVar("ListMatrix3D",bound=list[ListVector3D])
2526
ListMatrix3D.__doc__ = "Real space Matrix as list" # type: ignore

0 commit comments

Comments
 (0)