Skip to content

Implement the new calcfunction decorator.#2203

Merged
giovannipizzi merged 1 commit into
aiidateam:provenance_redesignfrom
sphuber:fix_2172_implement_calcfunction_decorator
Nov 15, 2018
Merged

Implement the new calcfunction decorator.#2203
giovannipizzi merged 1 commit into
aiidateam:provenance_redesignfrom
sphuber:fix_2172_implement_calcfunction_decorator

Conversation

@sphuber
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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