-
Notifications
You must be signed in to change notification settings - Fork 5
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
PythonJob spports exit code output #300
Merged
Merged
Conversation
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #300 +/- ##
==========================================
+ Coverage 75.75% 80.69% +4.94%
==========================================
Files 70 66 -4
Lines 4615 4947 +332
==========================================
+ Hits 3496 3992 +496
+ Misses 1119 955 -164
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
superstar54
force-pushed
the
feature/pythonjob_exit_code
branch
from
September 10, 2024 19:49
246a5fe
to
2c58f88
Compare
1) serialize and deserialize the properties when saving and loading the task 2) update the outputs of the task when loading the task.
superstar54
force-pushed
the
feature/pythonjob_exit_code
branch
from
September 10, 2024 20:22
2c58f88
to
aa38666
Compare
superstar54
force-pushed
the
feature/pythonjob_exit_code
branch
from
September 11, 2024 08:05
e4798ad
to
45d1c0f
Compare
GeigerJ2
pushed a commit
to GeigerJ2/aiida-workgraph
that referenced
this pull request
Sep 13, 2024
This PR adds a built-in output socket, `exit_code`, which serves as a mechanism for error handling and status reporting during task execution. This exit_code is `aiida.engine.ExitCode` with status and message. For the status, an integer value where 0 indicates a successful completion, and any non-zero value signals that an error occurred. * Move all function related to PythonJob to the PythonJob Task, so that we can handle serialization and deserialization correctly for PythonJob Task * Update the outputs of the task when loading the task in the error handler. so that we can use the outputs to update the input for next run.
GeigerJ2
added a commit
to GeigerJ2/aiida-workgraph
that referenced
this pull request
Sep 13, 2024
This PR adds a built-in output socket, `exit_code`, which serves as a mechanism for error handling and status reporting during task execution. This exit_code is `aiida.engine.ExitCode` with status and message. For the status, an integer value where 0 indicates a successful completion, and any non-zero value signals that an error occurred. * Move all function related to PythonJob to the PythonJob Task, so that we can handle serialization and deserialization correctly for PythonJob Task * Update the outputs of the task when loading the task in the error handler. so that we can use the outputs to update the input for next run.
agoscinski
pushed a commit
that referenced
this pull request
Sep 19, 2024
This PR adds a built-in output socket, `exit_code`, which serves as a mechanism for error handling and status reporting during task execution. This exit_code is `aiida.engine.ExitCode` with status and message. For the status, an integer value where 0 indicates a successful completion, and any non-zero value signals that an error occurred. * Move all function related to PythonJob to the PythonJob Task, so that we can handle serialization and deserialization correctly for PythonJob Task * Update the outputs of the task when loading the task in the error handler. so that we can use the outputs to update the input for next run.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows custom
exit_code
for PythonJob. Add a built-in output socket,exit_code
, which serves as a mechanism for error handling and status reporting during task execution. Thisexit_code
is dict withstatus
andmessage
. For thestatus
, an integer value where0
indicates a successful completion, and any non-zero value signals that an error occurred.How it Works:
When the function returns a dictionary with an
exit_code
key, the system automatically parses and uses this code to indicate the task's status. In the case of an error, the non-zeroexit_code
value helps identify the specific problem.Benefits of
exit_code
:Error Reporting:
If the task encounters an error, the
exit_code
can communicate the reason. This is helpful during process inspection to determine why a task failed.Error Handling and Recovery:
You can utilize
exit_code
to add specific error handlers for particular exit codes. This allows you to modify the task's parameters and restart it.Below is an example Python function that uses
exit_code
:In this example, the task failed with
exit_code = 1
due to the conditionSum is negative
, which is also reflected in the state message.Here is another example form PW calculation