You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/tipstricks.rst
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -379,6 +379,11 @@ These errors are caused by Numpy datatypes not being recognised by Pyro's serial
379
379
would require a mapping to the appropriate Java or .NET type)
380
380
381
381
382
+
.. sidebar:: msgpack + Numpy
383
+
384
+
*msgpack-numpy* (https://pypi.org/project/msgpack-numpy/) 'provides encoding and decoding routines that enable the serialization and deserialization of numerical and array data types provided by numpy using the highly efficient msgpack format'.
385
+
Pyro5 supports msgpack as serializer, so using that together with this library may solve the Numpy data serialization issues.
386
+
382
387
If you still want to use numpy with Pyro, you'll have to convert the data to standard Python datatypes before using them in Pyro.
383
388
So instead of just ``na = numpy.array(...); return na;``, use this instead: ``return na.tolist()``.
384
389
Or perhaps even ``return array.array('i', na)`` (serpent understands ``array.array`` just fine).
0 commit comments