Skip to content

Commit f8526cf

Browse files
authored
Merge branch 'master' into remove-copy
2 parents 481dd28 + 499db96 commit f8526cf

8 files changed

Lines changed: 394 additions & 9 deletions

File tree

neo/io/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
* :attr:`NestIO`
4646
* :attr:`NeuralynxIO`
4747
* :attr:`NeuroExplorerIO`
48+
* :attr:`NeuroNexusIO
4849
* :attr:`NeuroScopeIO`
4950
* :attr:`NeuroshareIO`
5051
* :attr:`NixIO`
@@ -191,6 +192,9 @@
191192
192193
.. autoattribute:: extensions
193194
195+
.. autoclass:: neo.io.NeuroNexusIO
196+
.. autoattribute:: extensions
197+
194198
.. autoclass:: neo.io.NeuroScopeIO
195199
196200
.. autoattribute:: extensions
@@ -326,6 +330,7 @@
326330
from neo.io.nestio import NestIO
327331
from neo.io.neuralynxio import NeuralynxIO
328332
from neo.io.neuroexplorerio import NeuroExplorerIO
333+
from neo.io.neuronexusio import NeuroNexusIO
329334
from neo.io.neuroscopeio import NeuroScopeIO
330335
from neo.io.nixio import NixIO
331336
from neo.io.nixio_fr import NixIO as NixIOFr
@@ -382,6 +387,7 @@
382387
NestIO,
383388
NeuralynxIO,
384389
NeuroExplorerIO,
390+
NeuroNexusIO,
385391
NeuroScopeIO,
386392
NeuroshareIO,
387393
NWBIO,

neo/io/neuronexusio.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from neo.io.basefromrawio import BaseFromRaw
2+
from neo.rawio.neuronexusrawio import NeuroNexusRawIO
3+
4+
5+
class NeuroNexusIO(NeuroNexusRawIO, BaseFromRaw):
6+
__doc__ = NeuroNexusRawIO.__doc__
7+
_prefered_signal_group_mode = "group-by-same-units"
8+
9+
def __init__(self, filename):
10+
NeuroNexusRawIO.__init__(self, filename=filename)
11+
BaseFromRaw.__init__(self, filename)

neo/rawio/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* :attr:`MicromedRawIO`
3030
* :attr:`NeuralynxRawIO`
3131
* :attr:`NeuroExplorerRawIO`
32+
* :attr:`NeuroNexusRawIO
3233
* :attr:`NeuroScopeRawIO`
3334
* :attr:`NIXRawIO`
3435
* :attr:`OpenEphysRawIO`
@@ -114,6 +115,10 @@
114115
115116
.. autoattribute:: extensions
116117
118+
.. autoclass:: neo.rawio.NeuroNexusRawIO
119+
120+
.. autoattributes:: extensions
121+
117122
.. autoclass:: neo.rawio.NeuroScopeRawIO
118123
119124
.. autoattribute:: extensions
@@ -197,6 +202,7 @@
197202
from neo.rawio.micromedrawio import MicromedRawIO
198203
from neo.rawio.neuralynxrawio import NeuralynxRawIO
199204
from neo.rawio.neuroexplorerrawio import NeuroExplorerRawIO
205+
from neo.rawio.neuronexusrawio import NeuroNexusRawIO
200206
from neo.rawio.neuroscoperawio import NeuroScopeRawIO
201207
from neo.rawio.nixrawio import NIXRawIO
202208
from neo.rawio.openephysrawio import OpenEphysRawIO
@@ -231,6 +237,7 @@
231237
MedRawIO,
232238
NeuralynxRawIO,
233239
NeuroExplorerRawIO,
240+
NeuroNexusRawIO,
234241
NeuroScopeRawIO,
235242
NIXRawIO,
236243
OpenEphysRawIO,

neo/rawio/intanrawio.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def _parse_header(self):
179179
self._raw_data = np.memmap(self.filename, dtype=memmap_data_dtype, mode="r", offset=header_size)
180180

181181
# for 'one-file-per-signal' we have one memory map / neo stream
182+
# based on https://github.com/NeuralEnsemble/python-neo/issues/1556 bug in versions 0.13.1, .2, .3
182183
elif self.file_format == "one-file-per-signal":
183184
self._raw_data = {}
184185
for stream_index, (stream_index_key, stream_datatype) in enumerate(memmap_data_dtype.items()):
@@ -188,8 +189,8 @@ def _parse_header(self):
188189
dtype_size = np.dtype(stream_datatype).itemsize
189190
n_samples = size_in_bytes // (dtype_size * num_channels)
190191
signal_stream_memmap = np.memmap(
191-
file_path, dtype=stream_datatype, mode="r", shape=(num_channels, n_samples)
192-
).T
192+
file_path, dtype=stream_datatype, mode="r", shape=(n_samples, num_channels), order='C',
193+
)
193194
self._raw_data[stream_index] = signal_stream_memmap
194195

195196
# for one-file-per-channel we have one memory map / channel stored as a list / neo stream

0 commit comments

Comments
 (0)