error with numpy array with ndim=0
Summary
-
bug appeared in last released -
bug appeared after Numpy update -
bug appeared after Python update -
I didn't use any previous release of IDSPy/IDSPy_toolkit
Package(s) involved
-
IDSPy_toolkit -
IDSPy -
gkids
Packages version
- IDSPy_toolkit : 0.4.0
Steps to reproduce
from dataclasses import dataclass, field
import idspy_toolkit
@dataclass
class ArrayClass:
val_array_0d: float = array(42.42), # array of shape 0
val_0d: float = 999.999,
val_array_1d: list[float] = array([1.234, ])
test_class_1 = ArrayClass()
try:
idspy_toolkit.ids_to_hdf5(test_class_1, "testfiles/file_ut_1.h5")
except OSError:
pass
new_ut = ArrayClass()
idspy_toolkit.hdf5_to_ids("testfiles/file_ut_1.h5",new_ut);
What is the current bug behavior?
exception throw due to the numpy.array of size 0
What is the expected correct behavior?
no exception