DiamondLightSource / SuRVoS

(Su)per (R)egion (Vo)lume (S)egmentaton workbench
Apache License 2.0
25 stars 5 forks source link

Crash if 'Add' button is pressed in Feature Channels tab when no feature selected from dropdown #67

Closed OllyK closed 5 years ago

OllyK commented 5 years ago

Get the following error when pressing 'Add' button to create feature channel when nothing is selected from the 'Select Feature' dropdown. This should fail more gracefully.

File "/scratch/olly/SuRVoS/survos/plugins/channels.py", line 189, in __init__
    fillvalue=np.nan)
  File "/scratch/olly/SuRVoS/survos/core/model.py", line 162, in create_empty_dataset
    ds.attrs[k] = v
  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 "/dls/science/users/vvw07985/venvs/bld_survos/lib/python3.6/site-packages/h5py/_hl/attrs.py", line 95, in __setitem__
    self.create(name, data=value, dtype=base.guess_dtype(value))
  File "/dls/science/users/vvw07985/venvs/bld_survos/lib/python3.6/site-packages/h5py/_hl/attrs.py", line 177, in create
    htype = h5t.py_create(original_dtype, logical=True)
  File "h5py/h5t.pyx", line 1630, in h5py.h5t.py_create
  File "h5py/h5t.pyx", line 1652, in h5py.h5t.py_create
  File "h5py/h5t.pyx", line 1707, in h5py.h5t.py_create
TypeError: Object dtype dtype('O') has no native HDF5 equivalent
Aborted

Aha! Link: https://dls1.aha.io/features/D-16