HS2 icon indicating copy to clipboard operation
HS2 copied to clipboard

Missing `expinds` attribute in `HSClustering`

Open b-grimaud opened this issue 1 year ago • 1 comments

When calling SaveHDF5 on an instance of HSClustering, I get the following :

AttributeError: 'HSClustering' object has no attribute 'expinds'

It seems like the __init__ of HSClustering used to declare expinds as a list if the object passed was a HSDetection instance, while now it is only declared if the instance is anything but HSDetection or HSDetectionLightning : https://github.com/mhhennig/HS2/blob/62e0b144a95befa5151b5e69b068b0cfe495c5fc/herdingspikes/hs2.py#L714-L717

I'm not sure what's the intended behavior : should expinds be declared in both cases ? Or should the dataset just contain an empty list if it wasn't declared above as with other attributes ? See : https://github.com/mhhennig/HS2/blob/62e0b144a95befa5151b5e69b068b0cfe495c5fc/herdingspikes/hs2.py#L904-L906

b-grimaud avatar Jul 18 '24 17:07 b-grimaud

Thanks for this! I hope this is fixed now, it's working here.

expinds is used in case multiple files are provided to the clustering class (e.g. multiple recordings from a single prep that can be concatenated, they can be detected individually and then have to be clustered together).

mhhennig avatar Jul 19 '24 16:07 mhhennig