saealib.registry.to_spec#
- saealib.registry.to_spec(obj)[source]#
Recursively serialize
objinto a spec (the reverse ofbuild()).Primitives,
None, lists/tuples, and dicts pass through structurally (numpy arrays become lists). Functions/builtins become a{"callable": "dotted.path"}marker. Other objects are reflected via their constructor signature: for each__init__parameter, the same-named attribute onobjis read and serialized recursively. A single*args(VAR_POSITIONAL) parameter is serialized as a params list instead of a dict, so it round-trips throughbuild()’s positional-call path.- Parameters:
obj (Any)
- Return type:
Any