Skip to content

Issue reading complex datatype written in Julia #13

Open
@phibeck

Description

@phibeck

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions