Skip to content

Commit

Permalink
add parse_chgcar/aeccar flags @jmmshn
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Oct 21, 2020
1 parent 9e29c0f commit ae281ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion emmet-cli/emmet/cli/tasks.py
Expand Up @@ -338,7 +338,9 @@ def restore(inputfile, file_filter):
show_default=True,
help="Number of processes for parallel parsing.",
)
def parse(task_ids, nproc):
@click.option("--parse-chgcar", is_flag=True, help="Parse CHGCAR.")
@click.option("--parse-aeccar", is_flag=True, help="Parse AECCAR.")
def parse(task_ids, nproc, parse_chgcar, parse_aeccar):
"""Parse VASP launchers into tasks"""
ctx = click.get_current_context()
if "CLIENT" not in ctx.obj:
Expand Down
8 changes: 7 additions & 1 deletion emmet-cli/emmet/cli/utils.py
Expand Up @@ -330,7 +330,6 @@ def parse_vasp_dirs(vaspdirs, tag, task_ids):
chunk_idx = int(name.rsplit("-")[1]) - 1
logger.info(f"{name} starting.")
tags = [tag, SETTINGS.year_tags[-1]]
drone = VaspDrone(parse_dos="auto", additional_fields={"tags": tags})
ctx = click.get_current_context()
spec_or_dbfile = ctx.parent.parent.params["spec_or_dbfile"]
target = calcdb_from_mgrant(spec_or_dbfile)
Expand All @@ -340,6 +339,13 @@ def parse_vasp_dirs(vaspdirs, tag, task_ids):
run = ctx.parent.parent.params["run"]
projection = {"tags": 1, "task_id": 1}
count = 0
kwargs = {}

for p in ["chgcar", "aeccar"]:
par = f"parse_{p}"
kwargs[par] = ctx.params[par]

drone = VaspDrone(additional_fields={"tags": tags}, **kwargs)

for vaspdir in vaspdirs:
logger.info(f"{name} VaspDir: {vaspdir}")
Expand Down

0 comments on commit ae281ee

Please sign in to comment.