Closed danielhollas closed 1 year ago
@sphuber I believe you added automatic serialization for calcfunctions. Would it make sense if to_aiida_type
was a default serializer for WorkChains as well? It would be a lot user and developer friendlier.
@sphuber I believe you added automatic serialization for calcfunctions.
Yes, I did indeed. Shipped with v2.1 I believe
Would it make sense if
to_aiida_type
was a default serializer for WorkChains as well? It would be a lot user and developer friendlier.
Not sure if this would be possible. The spec is defined by the subclass, which calls the super before it defines its own ports. So the base class won't get to intervene and automatically add the serializer to those ports. Not sure where to hook in to correct the port declarations.
Or we should override the __setitem__
method of the PortNamespace
class to set the serializer by default depending on the valid type. Could open an issue on aiida-core
to flesh the idea out a bit more.
Thanks @sphuber! I've opened https://github.com/aiidateam/aiida-core/issues/5890 for further discussion.
@pzarabadip this PR is good to go.
Thanks @danielhollas. Merged.
Fixes #60