OpenCyphal / pycyphal

Python implementation of the Cyphal protocol stack.
https://pycyphal.readthedocs.io/
MIT License
119 stars 106 forks source link

UX improvement: update_from_builtin() should automatically promote primitives to composites where possible #147

Closed pavel-kirienko closed 2 years ago

pavel-kirienko commented 3 years ago

I have seen similar reports a dozen times: https://github.com/UAVCAN/yakut/issues/8

The current behavior is not human-friendly because it is so easy to forget the correct nesting sequence when typing out YAML in the command line. The function update_from_builtin() should be modified to automatically promote primitives to composites where such promotion can be done unambiguously:

https://github.com/UAVCAN/pyuavcan/blob/master/pyuavcan/dsdl/_builtin_form.py#L124-L128