Skip to content

Feature Request: make MaterialsBuilder robust to task docs from multiple codes #159

@rkingsbury

Description

@rkingsbury

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions