emmet
emmet copied to clipboard
Bug when parsing LDA pseudopotential
Problem
Trying to read in a VASP run with an LDA (i.e. PAW but not PAW_PBE) pseudopotential causes a POTCAR parsing issue on emmet-core 0.69.6 and pmg 2023.10.4.
from emmet.core.tasks import TaskDoc
TaskDoc.from_directory('.')
File /global/common/software/matgen/rosen/miniconda/envs/quacc/lib/python3.10/sn, additional_fields, volume_change_warning_tol, **vasp_calculation_kwargs)
488 if vasp_objects:
489 included_objects = list(vasp_objects.keys())
491 doc = cls.from_structure(
492 structure=calcs_reversed[0].output.structure,
493 meta_structure=calcs_reversed[0].output.structure,
494 include_structure=True,
495 dir_name=dir_name,
496 calcs_reversed=calcs_reversed,
497 analysis=analysis,
498 transformations=transformations,
499 custodian=custodian,
500 orig_inputs=orig_inputs,
501 additional_json=additional_json,
502 icsd_id=icsd_id,
503 tags=tags,
504 author=author,
505 completed_at=calcs_reversed[0].completed_at,
--> 506 input=InputDoc.from_vasp_calc_doc(calcs_reversed[-1]),
507 output=OutputDoc.from_vasp_calc_doc(
508 calcs_reversed[0],
509 vasp_objects.get(VaspObject.TRAJECTORY), # type: ignore
510 ),
511 state=_get_state(calcs_reversed, analysis),
512 run_stats=_get_run_stats(calcs_reversed),
513 vasp_objects=vasp_objects,
514 included_objects=included_objects,
515 task_type=calcs_reversed[0].task_type,
516 )
517 doc = doc.model_copy(update=additional_fields)
518 return doc
File /global/common/software/matgen/rosen/miniconda/envs/quacc/lib/python3.10/s
195 if xc:
196 xc = xc.upper()
--> 198 pot_type, func = calc_doc.input.potcar_type[0].split("_")
199 func = "lda" if len(pot_type) == 1 else "_".join(func)
200 pps = Potcar(pot_type=pot_type, functional=func, symbols=calc_doc.input
ValueError: not enough values to unpack (expected 2, got 1)
I can't share a minimal example here due to proprietary reasons, but I can send one over Slack.
Proposed Solution
If the string label can't be split, assume LDA? I think?
Alternatives
No response