Skip to content

Commit a1175fd

Browse files
authored
Fix tests (#999)
2 parents 5e43b4f + 2747d8c commit a1175fd

File tree

5 files changed

+5
-17
lines changed

5 files changed

+5
-17
lines changed

mp_api/client/routes/materials/electrodes.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class ElectrodeRester(BaseRester[InsertionElectrodeDoc]):
1616

1717
def search( # pragma: ignore
1818
self,
19-
material_ids: str | list[str] | None = None,
2019
battery_ids: str | list[str] | None = None,
2120
average_voltage: tuple[float, float] | None = None,
2221
capacity_grav: tuple[float, float] | None = None,
@@ -43,8 +42,6 @@ def search( # pragma: ignore
4342
"""Query using a variety of search criteria.
4443
4544
Arguments:
46-
material_ids (str, List[str]): A single Material ID string or list of strings
47-
(e.g., mp-149, [mp-149, mp-13]).
4845
battery_ids (str, List[str]): A single battery ID string or list of strings
4946
(e.g., mp-22526_Li, [mp-22526_Li, mp-22526_Ca]).
5047
average_voltage (Tuple[float,float]): Minimum and maximum value of the average voltage for a particular
@@ -85,12 +82,6 @@ def search( # pragma: ignore
8582
"""
8683
query_params = defaultdict(dict) # type: dict
8784

88-
if material_ids:
89-
if isinstance(material_ids, str):
90-
material_ids = [material_ids]
91-
92-
query_params.update({"material_ids": ",".join(validate_ids(material_ids))})
93-
9485
if battery_ids:
9586
if isinstance(battery_ids, str):
9687
battery_ids = [battery_ids]

tests/materials/test_electrodes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def rester():
3333
} # type: dict
3434

3535
custom_field_tests = {
36-
"material_ids": ["mp-16722"],
3736
"battery_ids": ["mp-16722_Al"],
3837
"working_ion": Element("Li"),
3938
"formula": "CoO2",

tests/materials/test_robocrys.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ def test_client(rester):
2525
assert doc.condensed_structure is not None
2626

2727

28-
# TODO: switch this to the skipif once emmet PR 1261 is deployed to production
29-
# @pytest.mark.skipif(os.getenv("MP_API_KEY", None) is None, reason="No API key found.")
30-
@pytest.mark.skip(reason="Query with large result set fails with faceted pipeline")
28+
@pytest.mark.skipif(os.getenv("MP_API_KEY", None) is None, reason="No API key found.")
3129
def test_client_large_result_set(rester):
3230
search_method = rester.search
3331

tests/test_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
# "tasks",
3737
# "bonds",
3838
"materials_xas",
39+
"materials_tasks",
3940
"materials_elasticity",
4041
"materials_fermi",
4142
"materials_alloys",

tests/test_mprester.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
from pymatgen.entries.computed_entries import ComputedEntry, GibbsComputedStructureEntry
2828
from pymatgen.io.cif import CifParser
2929
from pymatgen.io.vasp import Chgcar
30-
from pymatgen.phonon.bandstructure import PhononBandStructureSymmLine
31-
from pymatgen.phonon.dos import PhononDos
30+
from emmet.core.phonon import PhononDOS, PhononBS
3231

3332
from mp_api.client import MPRester
3433
from mp_api.client.core.client import MPRestError
@@ -291,10 +290,10 @@ def test_get_ion_entries(self, mpr):
291290

292291
def test_get_phonon_data_by_material_id(self, mpr):
293292
bs = mpr.get_phonon_bandstructure_by_material_id("mp-2172")
294-
assert isinstance(bs, PhononBandStructureSymmLine)
293+
assert isinstance(bs, PhononBS)
295294

296295
dos = mpr.get_phonon_dos_by_material_id("mp-2172")
297-
assert isinstance(dos, PhononDos)
296+
assert isinstance(dos, PhononDOS)
298297

299298
def test_get_charge_density_from_material_id(self, mpr):
300299
chgcar = mpr.get_charge_density_from_material_id("mp-149")

0 commit comments

Comments
 (0)