Passing np.float32 type such as np.float32(0.0) gives b'np.float32(0.0)' instead of b'0.0'.
Casting to python float before generating the printable representation fixes this for me:
|
elif isinstance(arg, numbers.Real): |
|
return repr(arg).encode('ascii') |
elif isinstance(arg, numbers.Real):
return repr(float(arg)).encode('ascii')
This was on RFSoC ARM with Ubuntu 24.04.03, Python 3.12.3, Numpy 2.4.3 and katcp 0.9.3.
Passing np.float32 type such as
np.float32(0.0)givesb'np.float32(0.0)'instead ofb'0.0'.Casting to python float before generating the printable representation fixes this for me:
katcp-python/katcp/core.py
Lines 316 to 317 in 7a94c7d
This was on RFSoC ARM with Ubuntu 24.04.03, Python 3.12.3, Numpy 2.4.3 and katcp 0.9.3.