-
Notifications
You must be signed in to change notification settings - Fork 24
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
Problem with Flow's __deepcopy__
method
#398
Comments
Thanks for noticing this. I would be in favour of reverting the deepcopy implementation. It seems very specific and if we add new fields then we will also have to implement them in |
Good catch. I didn't have any specific use case in mind, just wanted to use it in a test but in hindsight, using |
Thanks for the quick fix! |
Just pushed a new version with the fix. |
PR #369 introduced the
__deepcopy__
magic method forFlow
, but there are a few issues with it.The most important is that it breaks when the output of the Flow is defined. A minimal example leading to the error:
giving:
The reason being the fact the Flow is created with no jobs but with the outputs:
jobflow/src/jobflow/core/flow.py
Line 228 in f157fdd
(note that this breaks some atomate2 tests)
The second issue that I identified is that the
hosts
are not handled correctly. Here an example:Whose output is:
showing that one of the host ids is lost.
A point that is not really clear is why the hosts are overwritten in the first place:
jobflow/src/jobflow/core/flow.py
Lines 230 to 231 in f157fdd
I am under the impression that the original idea was that the copied flow should have a different uuid from the original one, but this is not the case, since one of the
kwds
passed toFlow
is theuuid
.In the end, I am not sure which benefit brings implementing
__deepcopy__
instead of using thedeepcopy
from the standard library. @janosh, can you comment on this?The text was updated successfully, but these errors were encountered: