Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions mp_api/client/routes/materials/grain_boundaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def search(
gb_plane: list[str] | None = None,
gb_energy: tuple[float, float] | None = None,
pretty_formula: str | None = None,
rotation_axis: list[str] | None = None,
rotation_axis: tuple[int, int, int] | tuple[int, int, int, int] | None = None,
rotation_angle: tuple[float, float] | None = None,
separation_energy: tuple[float, float] | None = None,
sigma: int | None = None,
Expand All @@ -40,8 +40,10 @@ def search(
material_ids (List[str]): List of Materials Project IDs to query with.
pretty_formula (str): Formula of the material.
rotation_angle (Tuple[float,float]): Minimum and maximum rotation angle in degrees to consider.
rotation_axis(List[str]): The Miller index of rotation axis. e.g., [1, 0, 0], [1, 1, 0], and [1, 1, 1]
sigma (int): Sigma value of grain boundary.
rotation_axis (tuple of 3 int or of 4 int): The Miller index of rotation axis.
A 3- or 4-tuple of int or str: e.g.,
(0, 0, 0, 1), (1, 0, 0), (1, 1, 0), or (1, 1, 1)
sigma (int): Sigma value of grain boundary.
separation_energy (Tuple[float,float]): Minimum and maximum work of separation energy in J/m³ to consider.
sigma (int): Sigma value of the boundary.
type (GBTypeEnum): Grain boundary type.
Expand Down Expand Up @@ -84,6 +86,11 @@ def search(
)

if rotation_axis:
if len(rotation_axis) not in {3, 4}:
raise ValueError(
"`rotation_axis` should be a tuple of either "
"3 or 4 int values, ex: (0, 0, 0, 1) or (1, 0, 0)"
)
query_params.update(
{"rotation_axis": ",".join([str(n) for n in rotation_axis])}
)
Expand Down
Loading