DC-analysis / dclab

Python library for the post-measurement analysis of real-time deformability cytometry (RT-DC) data sets
https://dclab.readthedocs.io
Other
10 stars 12 forks source link

Exporting RTDC_HDF5 object with non-scalar, non-innate feature and active filters will throw Error #166

Closed maxschloegel closed 2 years ago

maxschloegel commented 2 years ago

Similar to issue #165 , the exporting of an RTDC_HDF5 instance (with non-scalar, non-innate plugin/temporary features) via ds.export.hdf5(..., filtering=True) will lead to

TypeError                                 Traceback (most recent call last)
<ipython-input-10-20cbf35c3674> in <module>
----> 1 ds.export.hdf5('non_scalar_test_export.rtdc', features=ds.features)

~/development/projects/dclab/dclab/rtdc_dataset/export.py in hdf5(self, path, features, filtered, override, compression)
    241                 else:
    242                     # We have to filter and will be slower
--> 243                     store_filtered_feature(rtdc_writer=hw,
    244                                            feat=feat,
    245                                            data=self.rtdc_ds[feat],

~/development/projects/dclab/dclab/rtdc_dataset/export.py in store_filtered_feature(rtdc_writer, feat, data, filtarr)
    376                 hw.store_feature("trace", {tr: trstack[:jj, :]})
    377     else:
--> 378         hw.store_feature(feat, data[filtarr])
    379 
    380 

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

~/.venvs/dcland/lib/python3.8/site-packages/h5py/_hl/dataset.py in __getitem__(self, args, new_dtype)
    781 
    782         # Perform the dataspace selection.
--> 783         selection = sel.select(self.shape, args, dataset=self)
    784 
    785         if selection.nselect == 0:

~/.venvs/dcland/lib/python3.8/site-packages/h5py/_hl/selections.py in select(shape, args, dataset)
     62         elif isinstance(arg, np.ndarray) and arg.dtype.kind == 'b':
     63             if arg.shape != shape:
---> 64                 raise TypeError("Boolean indexing array has incompatible shape")
     65             return PointSelection.from_mask(arg)
     66 

TypeError: Boolean indexing array has incompatible shape