Skip to content

Commit

Permalink
Merge pull request #765 from materialsproject/cli_updates
Browse files Browse the repository at this point in the history
Cli updates
  • Loading branch information
tschaume committed Jun 28, 2023
2 parents 058aec5 + bdf1825 commit b34aad0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion emmet-cli/emmet/cli/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,8 @@ def parse(task_ids, snl_metas, nproc, store_volumetric_data, runs): # noqa: C90
{"$group": {"_id": None, "num_max": {"$max": "$num_int"}}},
]
result = list(target.collection.aggregate(pipeline))
next_tid = result[0]["num_max"] + 1
# Manually set next_tid when parsing into an empty task collection for testing
next_tid = result[0]["num_max"] + 1 if result else 1000001
lst = [f"mp-{next_tid + n}" for n in range(nmax)]
task_ids = chunks(lst, chunk_size)

Expand Down
2 changes: 1 addition & 1 deletion emmet-cli/emmet/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def ensure_indexes(indexes, colls):
for coll in colls:
keys = [k.rsplit("_", 1)[0] for k in coll.index_information().keys()]
if index not in keys:
coll.ensure_index(index)
coll.create_index(index)
created[coll.full_name].append(index)

if created:
Expand Down

0 comments on commit b34aad0

Please sign in to comment.