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

Adapt message arguments passing to process controller #6668

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

unkcpz
Copy link
Member

@unkcpz unkcpz commented Dec 16, 2024

Changes required after aiidateam/plumpy#301 and aiidateam/plumpy#291

@unkcpz unkcpz force-pushed the conform-with-new-plumpy-message-options branch from 0f5beb4 to 05b51e4 Compare December 16, 2024 14:33
@unkcpz unkcpz requested a review from agoscinski as a code owner December 16, 2024 14:33
@unkcpz unkcpz force-pushed the conform-with-new-plumpy-message-options branch from a55e16c to 8751167 Compare December 16, 2024 14:34
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 77.92%. Comparing base (c532b34) to head (5f8e4f1).

Files with missing lines Patch % Lines
src/aiida/engine/processes/functions.py 50.00% 1 Missing ⚠️
src/aiida/engine/runners.py 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@khsrali khsrali left a 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)
Copy link
Contributor

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 .

Copy link
Member Author

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.

Copy link
Contributor

@khsrali khsrali left a 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.

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.

2 participants