Skip to content

Put in an explicit check raising when calculations call another process#2250

Merged
giovannipizzi merged 1 commit into
aiidateam:provenance_redesignfrom
sphuber:fix_2248_forbid_calculations_from_calling
Nov 29, 2018
Merged

Put in an explicit check raising when calculations call another process#2250
giovannipizzi merged 1 commit into
aiidateam:provenance_redesignfrom
sphuber:fix_2248_forbid_calculations_from_calling

Conversation

@sphuber
Copy link
Copy Markdown
Contributor

@sphuber sphuber commented Nov 29, 2018

Fixes #2248

By definition, calculation type processes cannot call other processes.
This was already indirectly guarded against by the link validation
process. If one attempted to add a CALL link from a CalulationNode,
the link validation would raise a ValueError. However, it is more
instructive for the user to catch this problem before attempting to add
the link. Therefore, when setting up the database record for a process,
if a parent process is available, we ensure that it is not a calculation
type process, or we raise an InvalidOperation exception. A test is
added for a calcfunction calling another calcfunction.

By definition, calculation type processes cannot call other processes.
This was already indirectly guarded against by the link validation
process. If one attempted to add a `CALL` link from a `CalulationNode`,
the link validation would raise a `ValueError`. However, it is more
instructive for the user to catch this problem before attempting to add
the link. Therefore, when setting up the database record for a process,
if a parent process is available, we ensure that it is not a calculation
type process, or we raise an `InvalidOperation` exception. A test is
added for a `calcfunction` calling another `calcfunction`.
@coveralls
Copy link
Copy Markdown

coveralls commented Nov 29, 2018

Coverage Status

Coverage increased (+0.08%) to 68.996% when pulling 98406d2 on sphuber:fix_2248_forbid_calculations_from_calling into fa8f617 on aiidateam:provenance_redesign.

@giovannipizzi giovannipizzi merged commit def85b5 into aiidateam:provenance_redesign Nov 29, 2018
@sphuber sphuber deleted the fix_2248_forbid_calculations_from_calling branch November 29, 2018 13:31
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