xtensor icon indicating copy to clipboard operation
xtensor copied to clipboard

xt::load_npy is unable to load zero-dimension .npy files on Windows 10

Open gebdadendo opened this issue 3 years ago • 1 comments

Loading the attached npy file, (float32, c-style) zero_dimensions.zip on Windows 10, the following occurs:

in line 532, xnpy.hpp: class std::runtime_error: This npy_file has already been cast.

If i dig deeper:

In line 703, xnpy.hpp: m_buffer is set to nullptr by detail::load_npy_file. That causes load_npy to throw an error:

I think the problem lies in the xt::detail::parse_header function. But I didn't have time to go deeper.

Best wishes, Gebdadendo

gebdadendo avatar Nov 24 '21 12:11 gebdadendo

This works on Ubuntu 20.0.4.

ghost avatar Nov 24 '21 13:11 ghost