-
Notifications
You must be signed in to change notification settings - Fork 78
Description
My task collection includes valid task documents generated by different codes (specifically, VASP and Qchem). If I have both VASP and Qchem task docs for materials with the same formula (in this case, Cl), MaterialsBuilder fails to build a materials document.
The failure is apparently a result of a KeyError, since Qchem task docs do not contain an orig_inputs key. Once this error is encountered, it seems to prevent .get_items() from finding any new materials to update.
2021-02-11 14:44:09,466 - MaterialsBuilder - ERROR - 'orig_inputs'
2021-02-11 14:44:09,466 - MaterialsBuilder - INFO - No items to update
I admit this is probably a corner case, but I think it's important that we make MaterialsBuilder as robust as possible.
This is really a validation issue. MaterialsBuilder relies on the task_types collection to determine which tasks are valid, but 'valid' only means valid within a particular code. It seems like we need some additional information in task_types to indicate what code generated the task doc in the first place. Then MaterialsBuilder could just filter for VASP docs.
Expected behavior:
MaterialsBuilder ignores invalid task documents, or task documents of the wrong type, and builds materials documents from the valid (VASP) task documents.
Actual behavior:
MaterialsBuilder does not generate any materials docs for the material.