aiidateam / plumpy

A python workflows library that supports writing Processes with a well defined set of inputs and outputs that can be strung together.
https://plumpy.readthedocs.io
Other
8 stars 17 forks source link

Make `Waiting.resume()` idempotent (#285) #286

Closed sebaB003 closed 3 months ago

sebaB003 commented 3 months ago

Calling Waiting.resume() when it had already been resumed would raise an exception. Here, the method is made idempotent by checking first whether the future has already been resolved. This fix ensures the behavior matches the behavior of the other state transitions: calling play on an already running process and calling pause on an already paused process isn't rising any error.

sebaB003 commented 3 months ago

I executed the tests on my local machine running python 3.11 and all tests passed, in the github workflow the tests on python 3.7 failed, maybe some dependencies are broken. Also python 3.7 have been discontinued 1 year ago, we could remove the test.

2024-07-01_15-22

sphuber commented 3 months ago

Thanks @sebaB003 . I have fixed the CI, cherry-picked your fix that was merged onto master and released a patch version v0.21.11: https://pypi.org/project/plumpy/0.21.11/ Let me know if that works.

Thanks for your contributions!