bluesky / ophyd

hardware abstraction in Python with an emphasis on EPICS
https://blueskyproject.io/ophyd
BSD 3-Clause "New" or "Revised" License
51 stars 79 forks source link

v2: BUG: No error raised upon casting array data from np.int64 to np.int32 #1145

Open olliesilvester opened 1 year ago

olliesilvester commented 1 year ago

Through the PVA client, upon trying to set an int32 dtype column PV using int64 data, no error will be thrown but the column will fail to be changed. Instead of an error being thrown, the traceback is printed to the console, eg:

test_panda.py::test_set_panda_table Unhandled Exception src/pvxs_client.cpp:67
Traceback (most recent call last):
  File "/scratch/qqh35939/panda_env/lib/python3.10/site-packages/p4p/client/raw.py", line 78, in builder
    V[k] = v
  File "src/p4p/_p4p.pyx", line 192, in p4p._p4p._Value.__setitem__
TypeError: Cannot cast array data from dtype('int64') to dtype('int32') according to the rule 'safe'
coretl commented 1 year ago

Reported upstream as https://github.com/mdavidsaver/p4p/issues/115