aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
412 stars 184 forks source link

PortNamespace supports `serializer` #6410

Open superstar54 opened 1 month ago

superstar54 commented 1 month ago

One can pass a serializer parameter to spec.input to automatically serialize the input into AiiDA data, such as to_aiida_type. For the moment, if I pass it into spec.input_namespace, it will raise an error,

spec.input_namespace("kwargs", valid_type=Data, required=False, serializer=to_aiida_type)
TypeError: PortNamespace.__init__() got an unexpected keyword argument 'serializer

It would be great to have this feature for spec.input_namespace too.