import tempfile
import numpy as np
import bohrium as bh
import h5py
if __name__ == '__main__':
with tempfile.NamedTemporaryFile() as tmp:
data = np.random.rand(100, 100)
with h5py.File(tmp, 'w') as f:
f['test'] = data
out = bh.empty((100, 100))
with h5py.File(tmp) as f:
out[...] = f['test'][...]
assert np.array_equal(out.copy2numpy(), data)
Output:
$ python bh_bug.py
bh_bug.py:17: UserWarning: Bohrium does not support the dtype 'float64', the new array will be a regular NumPy array.
out[...] = f['test']
Traceback (most recent call last):
File "bh_bug.py", line 17, in <module>
out[...] = f['test']
File "bohrium/ufuncs.pyx", line 55, in bohrium.ufuncs.setitem
File "bohrium/bhary.pyx", line 95, in bohrium.bhary.fix_biclass_wrapper.inner
File "bohrium/ufuncs.pyx", line 103, in bohrium.ufuncs.assign
ValueError: get_base() - the base object isn't a bohrium array!
Test script:
Output:
Works fine if I do