-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Code snippet
def get_structure_by_id(material_id:str, name:str=None):
"""
Get the structure of a material by its ID.
Parameters:
- material_id: The ID of the material to query.
Returns:
- The structure of the material and its cif file.
"""
with MPRester(mp_api_key) as mpr:
structure = mpr.get_structure_by_material_id(material_id, conventional_unit_cell=False)
structure.to(f"{name}_{material_id}.cif" if name else f"{material_id}.cif")
print(f"Structure for {material_id} saved as {name}_{material_id}.cif" if name else f"Structure for {material_id} saved as {material_id}.cif")
get_structure_by_id("mp-13", name="Fe")What happened?
for some reason the c axis from the queried structure (a primitive cell) is 4.05429521 and gamma is 109.46983668, which is inconsistent with those shown here (https://next-gen.materialsproject.org/materials/mp-13?chemsys=Fe)
with conventional_unit_cell=False:

with conventional_unit_cell=True:
right now my workaround is to query the conventional cell and convert it to primitive after which is fine, but figured I should also report the issue
screenshot from page of mp-13
conventional cell
primitive cell
also, if I try to download the primitive cell manually from the website it gives the conventional cell
appreciate any help with this; thanks!
Version
mp-api==0.45.13, pymatgen==2025.10.7
Which OS?
- MacOS
- Windows
- Linux
Log output
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working