-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
CalcJob
spec validator to corresponding namespaces
The `CalcJob` process had a single validator defined on the top level input namespace, which validated many ports scattered across the namespace, such as the `metadata.options.parser_name` as well as the `metadata.options.resources`. The validator assumed that all of these ports would always be present, however, this is not necessarily true. The expose functionality allows a wrapping process to expose only part of the namespace but the validator remains the same. To ammeliorate this, the signature of validators is updated to also receive a `context` in the form of a second argument `port` in addition to the value passed to the port. This `port` will be the instance of the port to which the validator is assigned. This allows the validator implementation to first check whether a specific port is present before trying to validate the corresponding value. Note that the `port` will represent the port to which the validator is attached and so it will have no knowledge of any namespace it might be embedded in, as it shouldn't, because that will break the portability of the namespace. The `port` argument being passed to the validator call was introduced in `plumpy==0.14.5` so we upgrade the minimum requirement here. Since that version also requires `pyyaml~=5.1.2` we also update that explicit version in `aiida-core`. Going to `pyyaml==5.2` will break until we fix the serialization and deserialization of process instances that are currently using the `FullLoader` that is no longer allowed to serialize arbitrary python objects as we do.
- Loading branch information
Showing
6 changed files
with
38 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters