HDFGroup / h5pyd

h5py distributed - Python client library for HDF Rest API
Other
109 stars 39 forks source link

Failures during vlen writes in test_dataset #197

Closed mattjala closed 1 month ago

mattjala commented 1 month ago

testall.py doesn't run test_dataset, so this failure has gone undetected until now.

The failure seems to result from a change in how variable-length data is processed before being passed to arrayToBytes.

Sample test output:

======================================================================
ERROR: test_int (__main__.TestVlen.test_int)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/matthewlarson/Documents/h5pyd/./test/hl/test_dataset.py", line 1624, in test_int
    ds[0] = np.arange(3)
    ~~^^^
  File "/home/matthewlarson/Documents/anaconda3/envs/new_env2/lib/python3.12/site-packages/h5pyd/_hl/dataset.py", line 1525, in __setitem__
    body = arrayToBytes(val, vlen=vlen)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/matthewlarson/Documents/anaconda3/envs/new_env2/lib/python3.12/site-packages/h5pyd/_hl/base.py", line 552, in arrayToBytes
    nSize = getByteArraySize(arr1d)
            ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/matthewlarson/Documents/anaconda3/envs/new_env2/lib/python3.12/site-packages/h5pyd/_hl/base.py", line 383, in getByteArraySize
    count += getElementSize(e, dt)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/home/matthewlarson/Documents/anaconda3/envs/new_env2/lib/python3.12/site-packages/h5pyd/_hl/base.py", line 363, in getElementSize
    raise ValueError(f"Unexpected value: {e}")
ValueError: Unexpected value: 1