Skip to content

Commit 4e47d09

Browse files
committed
remove fields arg from _query_open_data
1 parent 0cfff90 commit 4e47d09

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

mp_api/client/mprester.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,16 +1313,12 @@ def get_charge_density_from_task_id(
13131313
(Chgcar, (Chgcar, TaskDoc | dict), None): Pymatgen Chgcar object, or tuple with object and TaskDoc
13141314
"""
13151315
decoder = MontyDecoder().decode if self.monty_decode else json.loads
1316-
chgcar = (
1317-
self.materials.tasks._query_open_data(
1318-
bucket="materialsproject-parsed",
1319-
key=f"chgcars/{str(task_id)}.json.gz",
1320-
decoder=decoder,
1321-
fields=["data"],
1322-
)[0]
1323-
or {}
1316+
kwargs = dict(
1317+
bucket="materialsproject-parsed",
1318+
key=f"chgcars/{str(task_id)}.json.gz",
1319+
decoder=decoder,
13241320
)
1325-
1321+
chgcar = self.materials.tasks._query_open_data(**kwargs)[0]
13261322
if not chgcar:
13271323
raise MPRestError(f"No charge density fetched for task_id {task_id}.")
13281324

mp_api/client/routes/materials/electronic_structure.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ def get_bandstructure_from_task_id(self, task_id: str):
239239
bucket="materialsproject-parsed",
240240
key=f"bandstructures/{task_id}.json.gz",
241241
decoder=decoder,
242-
fields=["data"],
243242
)[0]
244243

245244
if result:
@@ -429,7 +428,6 @@ def get_dos_from_task_id(self, task_id: str):
429428
bucket="materialsproject-parsed",
430429
key=f"dos/{task_id}.json.gz",
431430
decoder=decoder,
432-
fields=["data"],
433431
)[0]
434432

435433
if result:

0 commit comments

Comments
 (0)