European-XFEL / h5glance

Explore HDF5 files in terminal & HTML views
BSD 3-Clause "New" or "Revised" License
68 stars 8 forks source link

Showing sample data fails on dataset where one dimension is 0 #7

Closed takluyver closed 6 years ago

takluyver commented 6 years ago
Traceback (most recent call last):
  File "/home/kluyvert/.local/bin/h5glance", line 4, in <module>
    main()
  File "/home/kluyvert/.local/lib/python3.6/site-packages/h5glance/terminal.py", line 294, in main
    display_h5_obj(f, path, expand_attrs=args.attrs)
  File "/home/kluyvert/.local/lib/python3.6/site-packages/h5glance/terminal.py", line 204, in display_h5_obj
    print_dataset_info(obj, file=sio)
  File "/home/kluyvert/.local/lib/python3.6/site-packages/h5glance/terminal.py", line 70, in print_dataset_info
    print(ds[select], file=file)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/home/kluyvert/.local/lib/python3.6/site-packages/h5py/_hl/dataset.py", line 476, in __getitem__
    selection = sel.select(self.shape, args, dsid=self.id)
  File "/home/kluyvert/.local/lib/python3.6/site-packages/h5py/_hl/selections.py", line 94, in select
    sel[args]
  File "/home/kluyvert/.local/lib/python3.6/site-packages/h5py/_hl/selections.py", line 261, in __getitem__
    start, count, step, scalar = _handle_simple(self.shape,args)
  File "/home/kluyvert/.local/lib/python3.6/site-packages/h5py/_hl/selections.py", line 451, in _handle_simple
    x,y,z = _translate_int(int(arg), length)
  File "/home/kluyvert/.local/lib/python3.6/site-packages/h5py/_hl/selections.py", line 471, in _translate_int
    raise ValueError("Index (%s) out of range (0-%s)" % (exp, length-1))
ValueError: Index (0) out of range (0--1)