Skip to content

Commit 247380f

Browse files
fix phonon alphaid to legacy mpid serialization
1 parent 9fd0c38 commit 247380f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

mp_api/client/routes/materials/phonon.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from typing import TYPE_CHECKING
66

77
from emmet.core.phonon import PhononBS, PhononBSDOSDoc, PhononBSDOSTask, PhononDOS
8+
from emmet.core.mpid import AlphaID
89

910
from mp_api.client.core import BaseRester, MPRestError, MPRestWarning
1011
from mp_api.client.core.utils import validate_ids
@@ -101,7 +102,7 @@ def get_bandstructure_from_phonon_id(
101102
"""
102103
result = self._query_open_data(
103104
bucket="materialsproject-parsed",
104-
key=f"ph-bandstructures/{phonon_method}/{identifier}.json.gz",
105+
key=f"ph-bandstructures/{phonon_method}/{AlphaID(identifier).string}.json.gz",
105106
)[0][0]
106107

107108
return (
@@ -136,7 +137,7 @@ def get_dos_from_phonon_id(
136137
"""
137138
result = self._query_open_data(
138139
bucket="materialsproject-parsed",
139-
key=f"ph-dos/{phonon_method}/{identifier}.json.gz",
140+
key=f"ph-dos/{phonon_method}/{AlphaID(identifier).string}.json.gz",
140141
)[0][0]
141142

142143
return (

0 commit comments

Comments
 (0)