Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IO to read MonkeyLogic files #1030

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion neo/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
* :attr:`KwikIO`
* :attr:`MaxwellIO`
* :attr:`MicromedIO`
* :attr:`MonkeyLogicIO`
* :attr:`NeoMatlabIO`
* :attr:`NestIO`
* :attr:`NeuralynxIO`
Expand Down Expand Up @@ -169,6 +170,10 @@

.. autoattribute:: extensions

.. autoclass:: neo.io.MonkeyLogicIO

.. autoattribute:: extensions

.. autoclass:: neo.io.NeoMatlabIO

.. autoattribute:: extensions
Expand Down Expand Up @@ -309,6 +314,7 @@
from neo.io.mearecio import MEArecIO
from neo.io.maxwellio import MaxwellIO
from neo.io.micromedio import MicromedIO
from neo.io.monkeylogicio import MonkeyLogicIO
from neo.io.neomatlabio import NeoMatlabIO
from neo.io.nestio import NestIO
from neo.io.neuralynxio import NeuralynxIO
Expand Down Expand Up @@ -361,7 +367,8 @@
MEArecIO,
MaxwellIO,
MicromedIO,
NixIO,
MonkeyLogicIO,
NixIO, # place NixIO before other IOs that use HDF5 to make it the default for .h5 files
NixIOFr,
NeoMatlabIO,
NestIO,
Expand Down
27 changes: 27 additions & 0 deletions neo/io/monkeylogicio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from neo.io.basefromrawio import BaseFromRaw
from neo.rawio.monkeylogicrawio import MonkeyLogicRawIO
import warnings

class MonkeyLogicIO(MonkeyLogicRawIO, BaseFromRaw):

name = 'MonkeyLogicIO'

_prefered_signal_group_mode = 'group-by-same-units'
_prefered_units_group_mode = 'all-in-one'

def __init__(self, filename):
MonkeyLogicRawIO.__init__(self, filename)
BaseFromRaw.__init__(self, filename)

def read_block(self, block_index=0, lazy=False,
create_group_across_segment=None,
signal_group_mode=None, load_waveforms=False):

if lazy:
warnings.warn('Lazy loading is not supported by MonkeyLogicIO. '
'Ignoring `lazy=True` parameter.')

return BaseFromRaw.read_block(self, block_index=block_index, lazy=False,
create_group_across_segment=create_group_across_segment,
signal_group_mode=signal_group_mode,
load_waveforms=load_waveforms)
Loading