Closed mbercx closed 1 year ago
@sphuber while working myself back into https://github.com/aiidateam/aiida-pseudo/pull/94 I decided to separate the work into different PR's since not everything is related to the same topic and it'll be easier to rebase/adapt/review.
Thanks @mbercx
Fixes #93
Currently the
family cutoffs set
command requires that the JSON file that contains the cutoffs only has the cutoff keys specified for each element. This is because the cutoffs are validated by theRecommendedCutoffMixin.validate_cutoffs()
method, which doesn't allow for extraneous keys.However, the
.json
file could have been adapted by the user from e.g. the SSSPmetadata.json
or some other dictionary that also contains other keys. As long as the cutoff keys are defined, we shouldn't raise an error just because there are other keys present.Here we first filter the data loaded from the JSON file for the cutoffs, before passing the dictionary to the
set_cutoffs
method.