OpenCyphal / pycyphal

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

DSDL generator: support direct assignment of uint8[<=] fields with memoryview #146

Closed pavel-kirienko closed 2 years ago

pavel-kirienko commented 3 years ago

Currently, one has to do this (assuming that the type of field is uint8[<=]):

dsdl_object.field = numpy.asarray(my_memoryview, dtype=numpy.uint8)

It is desirable to support automatic conversion:

dsdl_object.field = my_memoryview