Skip to content

Commit

Permalink
try fixing some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Jan 8, 2025
1 parent 5965618 commit a2054b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mp_api/client/mprester.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def get_material_id_references(self, material_id: str) -> list[str]:
Returns:
List of BibTeX references ([str])
"""
docs = self.provenance.search(material_ids=material_id)
docs = self.materials.provenance.search(material_ids=material_id)

if not docs:
return []
Expand Down
1 change: 1 addition & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"materials_electronic_structure_dos",
"materials_substrates",
"materials_synthesis",
"materials_similarity",
]

special_resters = ["materials_charge_density", "doi"]
Expand Down
9 changes: 2 additions & 7 deletions tests/test_mprester.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,7 @@ def test_get_entries(self, mpr):
assert e.data.get("energy_above_hull", None) is not None

# Conventional structure
formula = "BiFeO3"
entry = mpr.get_entry_by_material_id(
"mp-22526", inc_structure=True, conventional_unit_cell=True
)[0]
entry = mpr.get_entry_by_material_id("mp-22526", conventional_unit_cell=True)[1]

s = entry.structure
assert pytest.approx(s.lattice.a) == s.lattice.b
Expand All @@ -152,9 +149,7 @@ def test_get_entries(self, mpr):
assert pytest.approx(s.lattice.gamma) == 120

# Ensure energy per atom is same
prim = mpr.get_entry_by_material_id(
"mp-22526", inc_structure=True, conventional_unit_cell=False
)[0]
prim = mpr.get_entry_by_material_id("mp-22526", conventional_unit_cell=False)[1]

s = prim.structure
assert pytest.approx(s.lattice.a) == s.lattice.b
Expand Down

0 comments on commit a2054b6

Please sign in to comment.