You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe
In #5688, rekeased in AiiDA 2.1, to_aiida_type was added as the default serializer for calcfunctions and workfunctions.
It would be very useful to add the same functionality for WorkChains and CalcJobs to reduce the boilerplate.
Especially useful for beginner plugin developers.
Describe the solution you'd like
Input ports that have the corresponding Python base types (Bool, Int, Dict, Float...) would be automatically serialized for all CalcJobs and WorkChains, even even the serializer is not explictly defined.
Describe alternatives you've considered
Status quo, where to_aiida_type serialized must be explicitly set for all input ports where it applies.
Additional context
Here are initial thoughts about implementation details from @sphuber
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.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe
In #5688, rekeased in AiiDA 2.1,
to_aiida_type
was added as the default serializer for calcfunctions and workfunctions.It would be very useful to add the same functionality for WorkChains and CalcJobs to reduce the boilerplate.
Especially useful for beginner plugin developers.
Describe the solution you'd like
Input ports that have the corresponding Python base types (Bool, Int, Dict, Float...) would be automatically serialized for all CalcJobs and WorkChains, even even the serializer is not explictly defined.
Describe alternatives you've considered
Status quo, where
to_aiida_type
serialized must be explicitly set for all input ports where it applies.Additional context
Here are initial thoughts about implementation details from @sphuber
The text was updated successfully, but these errors were encountered: