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

plumpy.ProcessListener made persistent support/0.21.x #277

Closed rikigigi closed 11 months ago

rikigigi commented 11 months ago

Fixes https://github.com/aiidateam/plumpy/issues/273

We implement the persistence of ProcessListener by deriving the class ProcessListener and EventHelper from persistence.Savable. The class EventHelper is moved to a new file because of a circular import with utils and persistence

There was a circular reference issue in the test listener that was storing a reference to the process inside it, making its serialization impossible. To fix the tests an ugly hack was used: storing the reference to the process outside the class in a global dict using id as keys. Some more ugly hacks are needed to check correctly the equality of two processes. We must ignore the fact that the instances if the listener are different.

We call del on dict items of the ProcessListener's global implemented in the test suite to clean the golbal variables

addressed issues in https://github.com/aiidateam/plumpy/pull/274

codecov[bot] commented 11 months ago

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (31f85c7) 90.82% compared to head (303685a) 90.72%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## support/0.21.x #277 +/- ## ================================================== - Coverage 90.82% 90.72% -0.09% ================================================== Files 21 22 +1 Lines 2973 2995 +22 ================================================== + Hits 2700 2717 +17 - Misses 273 278 +5 ``` | [Files](https://app.codecov.io/gh/aiidateam/plumpy/pull/277?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidateam) | Coverage Δ | | |---|---|---| | [src/plumpy/base/utils.py](https://app.codecov.io/gh/aiidateam/plumpy/pull/277?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidateam#diff-c3JjL3BsdW1weS9iYXNlL3V0aWxzLnB5) | `100.00% <100.00%> (ø)` | | | [src/plumpy/utils.py](https://app.codecov.io/gh/aiidateam/plumpy/pull/277?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidateam#diff-c3JjL3BsdW1weS91dGlscy5weQ==) | `82.12% <ø> (+0.61%)` | :arrow_up: | | [src/plumpy/processes.py](https://app.codecov.io/gh/aiidateam/plumpy/pull/277?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidateam#diff-c3JjL3BsdW1weS9wcm9jZXNzZXMucHk=) | `92.47% <87.50%> (+0.02%)` | :arrow_up: | | [src/plumpy/process\_listener.py](https://app.codecov.io/gh/aiidateam/plumpy/pull/277?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidateam#diff-c3JjL3BsdW1weS9wcm9jZXNzX2xpc3RlbmVyLnB5) | `85.19% <78.58%> (-8.14%)` | :arrow_down: | | [src/plumpy/event\_helper.py](https://app.codecov.io/gh/aiidateam/plumpy/pull/277?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidateam#diff-c3JjL3BsdW1weS9ldmVudF9oZWxwZXIucHk=) | `77.42% <77.42%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.