Skip to content

Commit 1ca501f

Browse files
Merge pull request #1231 from samuelgarcia/speedup_blackrock
Option to not load nev in blackrock to speedup the opening
2 parents 7b24bb2 + 48d55d6 commit 1ca501f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

neo/rawio/blackrockrawio.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ class BlackrockRawIO(BaseRawIO):
108108
If 'all', then all nsX will be loaded.
109109
Contrary to previous version of the IO (<0.7), nsx_to_load
110110
must be set at the init before parse_header().
111+
load_nev (bool):
112+
Load (or not) events/spikes by ignoring or not the nev file.
113+
Default: True
111114
112115
Examples:
113116
>>> reader = BlackrockRawIO(filename='FileSpec2.3001', nsx_to_load=5)
@@ -126,7 +129,7 @@ class BlackrockRawIO(BaseRawIO):
126129
rawmode = 'multi-file'
127130

128131
def __init__(self, filename=None, nsx_override=None, nev_override=None,
129-
nsx_to_load=None, verbose=False):
132+
nsx_to_load=None, load_nev=True, verbose=False):
130133
"""
131134
Initialize the BlackrockIO class.
132135
"""
@@ -172,6 +175,9 @@ def __init__(self, filename=None, nsx_override=None, nev_override=None,
172175
self._avail_files[ext] = True
173176
if ext.startswith('ns'):
174177
self._avail_nsx.append(int(ext[-1]))
178+
179+
if not load_nev:
180+
self._avail_files['nev'] = False
175181

176182
if not self._avail_files['nev'] and not self._avail_nsx:
177183
raise IOError("No Blackrock files found in specified path")

0 commit comments

Comments
 (0)