ezpzbz / aiida-orca

AiiDA Plugin for ORCA
MIT License
7 stars 4 forks source link

Add to_aiida_type serializer for calcjob inputs #65

Closed danielhollas closed 1 year ago

danielhollas commented 1 year ago

Fixes #60

danielhollas commented 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 commented 1 year ago

@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.

danielhollas commented 1 year ago

Thanks @sphuber! I've opened https://github.com/aiidateam/aiida-core/issues/5890 for further discussion.

@pzarabadip this PR is good to go.

ezpzbz commented 1 year ago

Thanks @danielhollas. Merged.