124C41p / betterproto-rust-codec

MIT License
6 stars 0 forks source link

ndarray support #1

Closed atomicmac closed 6 months ago

atomicmac commented 7 months ago

It would be great if this could also serialize numpy ndarrays. There are a few other projects that support ndarrays over gRPC, but none for betterproto.

@Gobot1234 suggested this project when I mentioned ndarrays in the betterproto issues https://github.com/danielgtaylor/python-betterproto/pull/560#issuecomment-2016610988

124C41p commented 7 months ago

Serializing numpy arrays should work out of the box when using this package. There is currently one exception: serializing numpy boolean arrays will not work as of version 0.1.0 due to an issue with one of my dependencies. However, this issue is fixed in the latest version which was actually released three days ago. So I will update this package accordingly soon.

Note that there is currently no betterproto version released which uses this package, so you need to install it from github:

pip install "betterproto[rust-codec] @ git+https://github.com/danielgtaylor/python-betterproto.git"