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

Implement the new calcfunction decorator. #2203

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Nov 15, 2018

Fixes #2172

This calcfunction decorator replaces the make_inline and optional_inline
decorators, which are deprecated. The calcfunction operates identical to the
workfunction except the former gets a CalcFunctionNode to represent itself
in the provenance graph as opposed to the WorkFunctionNode of the latter.

The behavior of the optional_inline decorator is already intrinsically
contained within the calcfunction and workfunction decorators. Since under
the hood a FunctionProcess will be generated, and each process has an input
port store_provenace that can be toggled to False to prevent the provenance
from being stored, each calcfunction can be run without storing the provenance
by simply passing store_provenance=False when calling the function.

@sphuber sphuber force-pushed the fix_2172_implement_calcfunction_decorator branch from b54cd8d to 0b9fb4f Compare November 15, 2018 12:54
This `calcfunction` decorator replaces the `make_inline` and `optional_inline`
decorators, which are deprecated. The `calcfunction` operates identical to the
`workfunction` except the former gets a `CalcFunctionNode` to represent itself
in the provenance graph as opposed to the `WorkFunctionNode` of the latter.

The behavior of the `optional_inline` decorator is already intrinsically
contained within the `calcfunction` and `workfunction` decorators. Since under
the hood a `FunctionProcess` will be generated, and each process has an input
port `store_provenace` that can be toggled to `False` to prevent the provenance
from being stored, each `calcfunction` can be run without storing the provenance
by simply passing `store_provenance=False` when calling the function.
@sphuber sphuber force-pushed the fix_2172_implement_calcfunction_decorator branch from 0b9fb4f to e667ea0 Compare November 15, 2018 13:09
@coveralls
Copy link

coveralls commented Nov 15, 2018

Coverage Status

Coverage decreased (-0.02%) to 68.734% when pulling e667ea0 on sphuber:fix_2172_implement_calcfunction_decorator into e7a46cd on aiidateam:provenance_redesign.

Copy link
Member

@giovannipizzi giovannipizzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All very good!
I just think that this is a good moment to add a documentation about store_provenance

@sphuber
Copy link
Contributor Author

sphuber commented Nov 15, 2018

I consciously did not add it yet, because there is still #2180 . Should we discuss this a bit more and finalize a decision? Then I can put in the necessary documentation

Copy link
Member

@giovannipizzi giovannipizzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go then!

@giovannipizzi giovannipizzi merged commit 6b23ad0 into aiidateam:provenance_redesign Nov 15, 2018
@sphuber sphuber deleted the fix_2172_implement_calcfunction_decorator branch November 15, 2018 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants