TRIQS / h5

A high-level C++ interface to the hdf5 library
https://triqs.github.io/h5
Other
3 stars 7 forks source link

Issue reading complex datatype written in Julia #13

Open phibeck opened 1 year ago

phibeck commented 1 year ago

Description

h5 has an issue reading complex datatype written in Julia.

Steps to Reproduce

  1. create HDF5 archive in Julia

using HDF5 h5open("archive.h5", "w") do file
g = create_group(file, "group")
g["dataset_float"] = rand(5,5) g["dataset_complex"] = rand(5,5) + rand(5,5)im end

  1. load using TRIQS/h5

from h5 import HDFArchive with HDFArchive('archive.h5', 'r') as h5: dataset_float = h5['group']['dataset_float'] dataset_complex = h5['group']['dataset_complex']

  1. h5py instead works

import h5py hf = h5py.File('archive.h5', 'r') dataset_float = np.array(hf['group']['dataset_float']) dataset_complex = np.array(hf['group']['dataset_complex'])

Expected behavior: [What you expect to happen]

Actual behavior:

RuntimeError: .. Error occurred at Thu Jan 12 09:18:06 2023 .. Error .. calling C++ overload .. h5_read_bare(group g, std::string name) -> PyObject * .. in implementation of function _h5py.h5_read .. C++ error was : HDF5/Python Internal Error : can not find the numpy type from the HDF5 type

Versions

h5 version 1.1.x and unstable