Skip to content

Commit 36a6464

Browse files
committed
Heberto feedback
1 parent 3951020 commit 36a6464

File tree

6 files changed

+35
-29
lines changed

6 files changed

+35
-29
lines changed

neo/io/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* :attr:`NestIO`
4646
* :attr:`NeuralynxIO`
4747
* :attr:`NeuroExplorerIO`
48-
* :attr:`NeuronexusIO
48+
* :attr:`NeuroNexusIO
4949
* :attr:`NeuroScopeIO`
5050
* :attr:`NeuroshareIO`
5151
* :attr:`NixIO`
@@ -192,7 +192,7 @@
192192
193193
.. autoattribute:: extensions
194194
195-
.. autoclass:: neo.io.NeuronexusIO
195+
.. autoclass:: neo.io.NeuroNexusIO
196196
.. autoattribute:: extensions
197197
198198
.. autoclass:: neo.io.NeuroScopeIO
@@ -330,7 +330,7 @@
330330
from neo.io.nestio import NestIO
331331
from neo.io.neuralynxio import NeuralynxIO
332332
from neo.io.neuroexplorerio import NeuroExplorerIO
333-
from neo.io.neuronexusio import NeuronexusIO
333+
from neo.io.neuronexusio import NeuroNexusIO
334334
from neo.io.neuroscopeio import NeuroScopeIO
335335
from neo.io.nixio import NixIO
336336
from neo.io.nixio_fr import NixIO as NixIOFr
@@ -387,7 +387,7 @@
387387
NestIO,
388388
NeuralynxIO,
389389
NeuroExplorerIO,
390-
NeuronexusIO,
390+
NeuroNexusIO,
391391
NeuroScopeIO,
392392
NeuroshareIO,
393393
NWBIO,

neo/io/neuronexusio.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from neo.io.basefromrawio import BaseFromRaw
2-
from neo.rawio.neuronexusrawio import NeuronexusRawIO
2+
from neo.rawio.neuronexusrawio import NeuroNexusRawIO
33

44

5-
class NeuronexusIO(NeuronexusRawIO, BaseFromRaw):
6-
__doc__ = NeuronexusRawIO.__doc__
5+
class NeuroNexusIO(NeuroNexusRawIO, BaseFromRaw):
6+
__doc__ = NeuroNexusRawIO.__doc__
77
_prefered_signal_group_mode = "group-by-same-units"
88

99
def __init__(self, filename):
10-
NeuronexusRawIO.__init__(self, filename=filename)
10+
NeuroNexusRawIO.__init__(self, filename=filename)
1111
BaseFromRaw.__init__(self, filename)

neo/rawio/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* :attr:`MicromedRawIO`
3030
* :attr:`NeuralynxRawIO`
3131
* :attr:`NeuroExplorerRawIO`
32-
* :attr:`NeuronexusRawIO
32+
* :attr:`NeuroNexusRawIO
3333
* :attr:`NeuroScopeRawIO`
3434
* :attr:`NIXRawIO`
3535
* :attr:`OpenEphysRawIO`
@@ -115,7 +115,7 @@
115115
116116
.. autoattribute:: extensions
117117
118-
.. autoclass:: neo.rawio.NeuronexusRawIO
118+
.. autoclass:: neo.rawio.NeuroNexusRawIO
119119
120120
.. autoattributes:: extensions
121121
@@ -202,7 +202,7 @@
202202
from neo.rawio.micromedrawio import MicromedRawIO
203203
from neo.rawio.neuralynxrawio import NeuralynxRawIO
204204
from neo.rawio.neuroexplorerrawio import NeuroExplorerRawIO
205-
from neo.rawio.neuronexusrawio import NeuronexusRawIO
205+
from neo.rawio.neuronexusrawio import NeuroNexusRawIO
206206
from neo.rawio.neuroscoperawio import NeuroScopeRawIO
207207
from neo.rawio.nixrawio import NIXRawIO
208208
from neo.rawio.openephysrawio import OpenEphysRawIO
@@ -237,7 +237,7 @@
237237
MedRawIO,
238238
NeuralynxRawIO,
239239
NeuroExplorerRawIO,
240-
NeuronexusRawIO,
240+
NeuroNexusRawIO,
241241
NeuroScopeRawIO,
242242
NIXRawIO,
243243
OpenEphysRawIO,

neo/rawio/neuronexusrawio.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""
2-
Neuronexus has their own file format based on their Allego Recording System
2+
NeuroNexus has their own file format based on their Allego Recording System
33
https://www.neuronexus.com/webinar/allego-software-updates/
44
55
The format involves 3 files:
66
* The *.xdat.json metadata file
77
* The *_data.xdat binary file of all raw data
8-
* The *_timestamps.xdat binary file of the timeestamp data
8+
* The *_timestamps.xdat binary file of the timestamp data
99
1010
Based on sample data is appears that the binary file is always a float32 format
1111
Other information can be found within the metadata json file
@@ -23,9 +23,11 @@
2323
like channel_names, channel_ids, channel_types.
2424
2525
An additional note on channels. It appears that analog channels are called `pri` or
26-
`ai0` within the metadata where as digital channels are called `din0` or `dout0`.
26+
`ai0` within the metadata whereas digital channels are called `din0` or `dout0`.
2727
In this first implementation it is up to the user to do the appropriate channel slice
28-
to only get the data they want.
28+
to only get the data they want. This is a buffer-based approach that Sam likes.
29+
Eventually we will try to divide these channels into streams (analog vs digital) or
30+
we can come up with a work around if users open an issue requesting this.
2931
3032
Zach McKenzie
3133
@@ -47,14 +49,14 @@
4749
from neo.core import NeoReadWriteError
4850

4951

50-
class NeuronexusRawIO(BaseRawIO):
52+
class NeuroNexusRawIO(BaseRawIO):
5153

5254
extensions = ["xdat", "json"]
5355
rawmode = "one-file"
5456

5557
def __init__(self, filename: str | Path = ""):
5658
"""
57-
The Allego Neuronexus reader for the `xdat` file format
59+
The Allego NeuroNexus reader for the `xdat` file format
5860
5961
Parameters
6062
----------
@@ -66,12 +68,12 @@ def __init__(self, filename: str | Path = ""):
6668
* The format involves 3 files:
6769
* The *.xdat.json metadata file
6870
* The *_data.xdat binary file of all raw data
69-
* The *_timestamps.xdat binary file of the timeestamp data
71+
* The *_timestamps.xdat binary file of the timestamp data
7072
From the metadata the other two files are located within the same directory
7173
and loaded.
7274
7375
* The metadata is stored as the metadata attribute for individuals hoping
74-
to extract probe information, but neo itself does not load any of the probe
76+
to extract probe information, but Neo itself does not load any of the probe
7577
information
7678
7779
Examples
@@ -146,7 +148,11 @@ def _parse_header(self):
146148
# We can do a quick timestamp check to make sure it is the correct timestamp data for the
147149
# given metadata
148150
if self._timestamps[0] != self.metadata["status"]["timestamp_range"][0]:
149-
raise NeoReadWriteError(f"The metadata indicates a different starting timestamp")
151+
metadata_start = self.metadata["status"]["timestamp_range"][0]
152+
data_start = self._teimstamps[0]
153+
raise NeoReadWriteError(
154+
f"The metadata indicates a different starting timestamp {metadata_start} than the data starting timestamp {data_start}"
155+
)
150156

151157
# organize the channels
152158
signal_channels = []
@@ -156,7 +162,7 @@ def _parse_header(self):
156162
# and because all data is stored in the same buffer stream for the moment all channels
157163
# will be in stream_id = 0. In the future this will be split into sub_streams based on
158164
# type but for now it will be the end-users responsability for this.
159-
stream_id = 0 # hard-coded see note above
165+
stream_id = '0' # hard-coded see note above
160166
for channel_index, channel_name in enumerate(channel_info["chan_name"]):
161167
channel_id = channel_info["ntv_chan_name"][channel_index]
162168
# 'ai0' indicates analog data which is stored as microvolts
@@ -272,4 +278,4 @@ def read_metadata(self, fname_metadata):
272278
# this is pretty useless right now, but I think after a
273279
# refactor with sub streams we could adapt this for the sub-streams
274280
# so let's leave this here for now :)
275-
stream_id_to_stream_name = {0: "Neuronexus Allego Data"}
281+
stream_id_to_stream_name = {'0': "Neuronexus Allego Data"}

neo/test/iotest/test_neuronexusio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
import unittest
66

7-
from neo.io import NeuronexusIO
7+
from neo.io import NeuroNexusIO
88
from neo.test.iotest.common_io_test import BaseTestIO
99

1010

11-
class TestNeuronexusIO(
11+
class TestNeuroNexusIO(
1212
BaseTestIO,
1313
unittest.TestCase,
1414
):
15-
ioclass = NeuronexusIO
15+
ioclass = NeuroNexusIO
1616
entities_to_download = ["neuronexus"]
1717
entities_to_test = ["neuronexus/allego_1/allego_2__uid0701-13-04-49.xdat.json"]
1818

neo/test/rawiotest/test_neuronexusrawio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import unittest
22
import numpy as np
33

4-
from neo.rawio.neuronexusrawio import NeuronexusRawIO
4+
from neo.rawio.neuronexusrawio import NeuroNexusRawIO
55
from neo.test.rawiotest.common_rawio_test import BaseTestRawIO
66

77

8-
class TestNeuronexusRawIO(
8+
class TestNeuroNexusRawIO(
99
BaseTestRawIO,
1010
unittest.TestCase,
1111
):
12-
rawioclass = NeuronexusRawIO
12+
rawioclass = NeuroNexusRawIO
1313
entities_to_download = ["neuronexus"]
1414
entities_to_test = [
1515
"neuronexus/allego_1/allego_2__uid0701-13-04-49.xdat.json"

0 commit comments

Comments
 (0)