lsmo-epfl / aiida-lsmo

AiiDA workflows for the LSMO laboratory at EPFL
Other
9 stars 13 forks source link

Urgent need to validate the parameters Dict #39

Closed danieleongari closed 3 years ago

danieleongari commented 4 years ago

Dicts like "IsothermParameters" are very dangerous, since a typo in the key makes the work chain neglect that key and use the default settings. Typical cases are key that were changed in more recent versions, such as:

Therefore, there is an urgent need to validate the dictionary (that should not contain keys that are not in the default dictionary) and possibly make this work so that the outer work chain already complains at the start if any Isotherm sub-work chain gets an unexpected Dict as input.

danieleongari commented 4 years ago

Another common source of error, is to use scientific notation (e.g., 10e-5) in the YAML file with the parameters, and use a parser that does not convert it to float }(e.g., yaml.safe_load(), while ruamel should work fine. The work chain crashes when this produces and error, while an initial validation would immediately reject the submission.

danieleongari commented 4 years ago

Yet another source of error are None values that are by default written in YAML files as null. Therefore, if None is used in a YAML file, this will be interpreted as a string, causing troubles for the work chain. The case here is for the key pressure_list.

ltalirz commented 3 years ago

PR https://github.com/lsmo-epfl/aiida-lsmo/pull/62 should address all of the above mentioned issues: