Thomas Kluyver, European XFEL
This project has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No. 823852.
f = h5py.File('sample.h5', 'r') f.keys()
<KeysViewHDF5 ['group', 'links']>
<HDF5 group "/group" (4 members)>
<KeysViewHDF5 ['complex', 'custom_float', 'integers', 'strings']>
This works, but it's not very convenient to inspect a file.
There are applications like HDFview, Vitables & h5web, but that means leaving your notebook context and opening the same file in a separate application. H5Glance is designed to fit into the notebook (or terminal) context.
from h5glance import H5Glance
The whole structure is created up-front - this may be slower, but it just works in a static HTML export of the notebook, including on Nbviewer.
H5Glance doesn't show your data - it's easy & flexible to inspect data with other libraries, so we're not trying to cover that. But the clipboard icons by dataset names let you copy the path to the dataset, so you can paste it into code.
import matplotlib.pyplot as plt
<matplotlib.colorbar.Colorbar at 0x7fcea6b5cd00>
This is the structure of our HDF5 files at European XFEL. We're often working through many layers of nested groups.
import h5glance h5glance.install_ipython_h5py_display()
This was demoed separately. Features include:
sample.h5 ├group (2 attributes) │ ├complex [(r: float64, i: float64): 1024 × 1024] │ ├custom_float [custom 2-byte float: 4 × 7] │ ├integers [int64: 10 × 6 × 5] │ └strings [UTF-8 string: 4] └links ├external -> fxe_control_example.h5//INDEX/trainId ├hard = /group/integers └soft -> /group/integers