Skip to content

Commit d91ee27

Browse files
committed
add phonon method search param
1 parent 031c2c4 commit d91ee27

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mp_api/client/routes/materials/phonon.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class PhononRester(BaseRester[PhononBSDOSDoc]):
1616
def search(
1717
self,
1818
material_ids: str | list[str] | None = None,
19+
phonon_method: str | None = None,
1920
num_chunks: int | None = None,
2021
chunk_size: int = 1000,
2122
all_fields: bool = True,
@@ -26,6 +27,7 @@ def search(
2627
Arguments:
2728
material_ids (str, List[str]): A single Material ID string or list of strings
2829
(e.g., mp-149, [mp-149, mp-13]).
30+
phonon_method (str): phonon method to search (dfpt, phonopy, pheasy)
2931
num_chunks (int): Maximum number of chunks of data to yield. None will yield all possible.
3032
chunk_size (int): Number of data entries per chunk.
3133
all_fields (bool): Whether to return all fields in the document. Defaults to True.
@@ -41,7 +43,10 @@ def search(
4143
if isinstance(material_ids, str):
4244
material_ids = [material_ids]
4345

44-
query_params.update({"material_ids": ",".join(validate_ids(material_ids))})
46+
query_params["material_ids"] = ",".join(validate_ids(material_ids))
47+
48+
if phonon_method and phonon_method in {"dfpt", "phonopy", "pheasy"}:
49+
query_params["phonon_method"] = phonon_method
4550

4651
query_params = {
4752
entry: query_params[entry]

0 commit comments

Comments
 (0)