nqxpack.registry.register_automatic_serialization

nqxpack.registry.register_automatic_serialization#

nqxpack.registry.register_automatic_serialization(cls, *attrs, array_to_list=False, **attr_map)[source]#

Register a simple serialization function for a class that just serializes the given attributes.

Parameters:
  • cls – The class to register the serialization for

  • *attrs – The attributes to serialize and pass to the constructor directily

  • **attr_map – A mapping of the attribute name to the name of the attribute in the object

  • array_to_list (bool) – If True, arrays with ndim <= 1 will be converted to lists