Skip to content

Commit 5073a7b

Browse files
author
sprenger
committed
[MLIO] add non-lazy warning
1 parent d41dba1 commit 5073a7b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

neo/io/monkeylogicio.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from neo.io.basefromrawio import BaseFromRaw
22
from neo.rawio.monkeylogicrawio import MonkeyLogicRawIO
3-
3+
import warnings
44

55
class MonkeyLogicIO(MonkeyLogicRawIO, BaseFromRaw):
66

@@ -13,9 +13,15 @@ def __init__(self, filename):
1313
MonkeyLogicRawIO.__init__(self, filename)
1414
BaseFromRaw.__init__(self, filename)
1515

16-
def __enter__(self):
17-
return self
16+
def read_block(self, block_index=0, lazy=False,
17+
create_group_across_segment=None,
18+
signal_group_mode=None, load_waveforms=False):
19+
20+
if lazy:
21+
warnings.warn('Lazy loading is not supported by MonkeyLogicIO. '
22+
'Ignoring `lazy=True` parameter.')
1823

19-
def __exit__(self, *args):
20-
self.header = None
21-
self.file.close()
24+
return BaseFromRaw.read_block(self, block_index=block_index, lazy=False,
25+
create_group_across_segment=create_group_across_segment,
26+
signal_group_mode=signal_group_mode,
27+
load_waveforms=load_waveforms)

0 commit comments

Comments
 (0)