Skip to content

Commit 0786122

Browse files
committed
retrieve atomate2 tasks from opendata
1 parent 4e47d09 commit 0786122

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

mp_api/client/core/client.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,14 @@ def _query_resource(
476476
suffix = suffix.replace("_", "-")
477477

478478
# Paginate over all entries in the bucket.
479-
# This will have to change for when a subset of entries from
480-
# the DB is needed.
481-
is_tasks = "tasks" in suffix
482-
bucket_suffix = "parsed" if is_tasks else "build"
479+
# TODO: change when a subset of entries needed from DB
480+
if "tasks" in suffix:
481+
bucket_suffix, prefix = "parsed", "tasks_atomate2"
482+
else:
483+
bucket_suffix = "build"
484+
prefix = f"collections/{db_version}/{suffix}"
485+
483486
bucket = f"materialsproject-{bucket_suffix}"
484-
prefix = suffix if is_tasks else f"collections/{db_version}/{suffix}"
485487
paginator = self.s3_client.get_paginator("list_objects_v2")
486488
pages = paginator.paginate(Bucket=bucket, Prefix=prefix)
487489

0 commit comments

Comments
 (0)