Description
Problem
I have encountered a problem related to undocumented segments in Blackrock NEV files. In the file blackrockrawio.py, function ____get_event_segment_ids, the code identifies 2 undocumented segments within NEV data and outputs a warning but adds segment IDs to address the problem.
blackrockrawio.py:1164: UserWarning: Detected 2 undocumented segments within nev data after timestamps [1209981 1256384].
(This would be line 1157 in the latest version)
Later on, in function __match_nsx_and_nev_segment_ids, the final assertion that NSx and NEV files have the same number of segments fails (because nb_possible_nev_segments = 6 and len(nonempty_nsx_segments) = 5).
AssertionError: Inconsistent ns6 and nev file. 6 segments present in .nev file, but 5 in ns6 file.
(Line 1266 in latest version.)
I am wondering if this is a bug in the way that undocumented segments are handled, or whether this issue requires a separate workaround.
To Reproduce
I'm not sure the simplest way to reproduce the error, as I am encountering the error through the chain of neuroconv --> spikeinterface --> neo. However, I could share the files privately if that is helpful (about 2.5GB in total for .nev and .ns6 files).
Expected behaviour
I expected the segments in the NEV file to automatically be adjusted and mapped to ns6 segments.
Environment:
- OS: Linux
- Python version: 3.11.5
- Neo version: 0.12.0 (I am suprised by this, obatained with neo.version, since the latest version on github is 0.11.1)
- NumPy version: 1.26.2