Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process functions: Allow nested output namespaces #5954

Merged

Commits on Apr 4, 2023

  1. Process functions: Allow nested output namespaces

    Up till now, the following was not possible:
    
        @calcfunction
        def add(x, y):
            return {'nested.output': x + y}
    
    An exception would be raised by `plumpy` because the `nested` output
    namespace, defined by the `ProcessSpec` that is automatically generated
    from the function signature, does not contain the port `output`. The
    automatically generated process spec _does_ mark the outputs namespace
    as dynamic, but this was not being applied recursively.
    
    Not only is this functionality for users, the `Parser.parse_from_node`
    functonality is currently broken if the `Parser` returns output nodes in
    nested namespaces. The reason is that the `parse_from_node` creates a
    `calcfunction` on-the-fly which raises when it gets the outputs with the
    nested labels. Even though the original `Process` class may have
    specified these nested output namespaces, the on-the-fly calcfunction to
    capture the manual re-parsing does not support this.
    
    The addition of this functionality requires a change in `plumpy` which
    was released with `plumpy==0.21.6` which is therefore made the minimum
    required version.
    
    This version also includes another fix where the recently introduced
    check on the type of the return value of a workchain conditional
    predicate, was changed from raising an exception, to logging a
    deprecation warning. The correspondig test is updated to check that the
    user warning is emitted instead of catching the exception.
    sphuber committed Apr 4, 2023
    Configuration menu
    Copy the full SHA
    5169803 View commit details
    Browse the repository at this point in the history