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 12 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.99%. Comparing base (5e8bbe1) to head (a78fff5).

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.99%   77.99%   +0.01%     
==========================================
  Files         563      563              
  Lines       41761    41762       +1     
==========================================
+ Hits        32567    32570       +3     
+ Misses       9194     9192       -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.

Copy link
Contributor

@agoscinski agoscinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay, just needs to be rebased after plumpy release

src/aiida/engine/processes/control.py Outdated Show resolved Hide resolved
@@ -231,7 +234,7 @@ def _perform_actions(
continue

try:
future = action(process.pk, **kwargs)
future = action(process.pk)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are the docs still up to date if you remove usage of kwargs?

Copy link
Member Author

@unkcpz unkcpz Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I just remove the use of kwargs and the docstring see 72b77cb

@unkcpz unkcpz force-pushed the conform-with-new-plumpy-message-options branch from 87d7c51 to 3fd268a Compare January 8, 2025 15:26
@unkcpz
Copy link
Member Author

unkcpz commented Jan 8, 2025

@khsrali I rebase with the main branch of plumpy, all CI code tests are passed. We can make a release for plumpy.

@unkcpz unkcpz requested a review from khsrali January 8, 2025 22:08
@unkcpz unkcpz requested a review from agoscinski January 10, 2025 00:23
@unkcpz
Copy link
Member Author

unkcpz commented Jan 10, 2025

Hi @khsrali, I update plumpy version, should all good now. Can you have another look?

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