NeuralEnsemble / python-neo

Neo is a package for representing electrophysiology data in Python, together with support for reading a wide range of neurophysiology file formats
http://neo.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
325 stars 248 forks source link

Plexon signal stream_ids are not cosistent across reads #1523

Closed h-mayorquin closed 2 months ago

h-mayorquin commented 3 months ago

The problem is here:

https://github.com/NeuralEnsemble/python-neo/blob/315f485eb24c8d17aaebc5d6b56a336840913b66/neo/rawio/plexonrawio.py#L269-L275

We use set to form unique users group, enumerate over them to determine stream_index and use str(stream_index) as a stream_id. But this does not work because iterating over sets and determining sets is not deterministic.

samuelgarcia commented 2 months ago

yep. set is dangerous for that. np.unique() could be a better choice.

zm711 commented 2 months ago

Fixed with a dictionary strategy in #1524. Closing.