-
Notifications
You must be signed in to change notification settings - Fork 192
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
Adapt message arguments passing to process controller #6668
base: main
Are you sure you want to change the base?
Adapt message arguments passing to process controller #6668
Conversation
0f5beb4
to
05b51e4
Compare
a55e16c
to
8751167
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6668 +/- ##
==========================================
+ Coverage 77.92% 77.92% +0.01%
==========================================
Files 563 563
Lines 41671 41672 +1
==========================================
+ Hits 32467 32470 +3
+ Misses 9204 9202 -2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @unkcpz , I have just one comment.
@@ -199,7 +201,8 @@ def kill_processes( | |||
return | |||
|
|||
controller = get_manager().get_process_controller() | |||
_perform_actions(processes, controller.kill_process, 'kill', 'killing', timeout, wait, msg=message) | |||
action = functools.partial(controller.kill_process, msg_text=msg_text) | |||
_perform_actions(processes, action, 'kill', 'killing', timeout, wait) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @unkcpz
in _perform_actions
we have:
future = action(process.pk, **kwargs)
Therefore I would suggest, either put everything inside functools.partial
so it would be serve as we suggested and discussed (one action that would be triggered), or probably take the msg_text out
.
Right now, it's kinda hard to understand why because the rest of arguments are passed via **kwargs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, makes sense. I I removed the kwargs and add the typing for action argument as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@unkcpz thanks a lot! changes makes sense.
As agreed let's wait for a plumpy
release before merging this. and we have to remember to remove the commit hook for plumpy
so to pin the to-be-released version.
Changes required after aiidateam/plumpy#301 and aiidateam/plumpy#291