Skip to content

Commit 72f0787

Browse files
committed
merge with main and resolve conflicts
2 parents f2dd922 + dbd2482 commit 72f0787

19 files changed

+552
-113
lines changed

.github/workflows/core-test.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,9 @@ jobs:
2626
matrix:
2727
os: ["ubuntu-latest", "windows-latest"]
2828
# "macos-latest",
29-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
30-
numpy-version: ['1.20.3', '1.21.6', '1.22.4', '1.23.5', '1.24.1', '1.25.1', '1.26.4']
29+
python-version: ['3.9', '3.10', '3.11', '3.12']
30+
numpy-version: ['1.22.4', '1.23.5', '1.24.1', '1.25.1', '1.26.4']
3131
exclude:
32-
- python-version: '3.8'
33-
numpy-version: '1.25.1'
34-
- python-version: '3.8'
35-
numpy-version: '1.26.4'
36-
- python-version: '3.10'
37-
numpy-version: '1.20.3'
38-
- python-version: '3.11'
39-
numpy-version: '1.20.3'
40-
- python-version: '3.11'
41-
numpy-version: '1.21.6'
42-
- python-version: '3.12'
43-
numpy-version: '1.20.3'
44-
# python 3.12 only works on latest numpy
45-
- python-version: '3.12'
46-
numpy-version: '1.21.6'
4732
- python-version: '3.12'
4833
numpy-version: '1.22.4'
4934
- python-version: '3.12'

codemeta.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
"license": "https://spdx.org/licenses/BSD-3-Clause",
55
"codeRepository": "https://github.com/NeuralEnsemble/python-neo",
66
"contIntegration": "https://github.com/NeuralEnsemble/python-neo/actions",
7-
"dateModified": "2024-08-01",
8-
"downloadUrl": "https://files.pythonhosted.org/packages/0f/16/4e22eb38621183d56acde0abbe591f15e79c6332e9ec360fc5db171b39ab/neo-0.13.2.tar.gz",
7+
"dateModified": "2024-08-28",
8+
"downloadUrl": "https://files.pythonhosted.org/packages/08/4b/c863c6bff783e94c92cb814f6ae821b35e6463c5a66e809b6864d0c66b4e/neo-0.13.3.tar.gz",
99
"issueTracker": "https://github.com/NeuralEnsemble/python-neo/issues",
1010
"name": "Neo",
11-
"version": "0.13.2",
11+
"version": "0.13.3",
1212
"identifier": "RRID:SCR_000634",
1313
"description": "Neo is a Python package for working with electrophysiology data in Python, together with support for reading a wide range of neurophysiology file formats, including Spike2, NeuroExplorer, AlphaOmega, Axon, Blackrock, Plexon, Tdt, and support for writing to a subset of these formats plus non-proprietary formats including HDF5.\n\nThe goal of Neo is to improve interoperability between Python tools for analyzing, visualizing and generating electrophysiology data by providing a common, shared object model. In order to be as lightweight a dependency as possible, Neo is deliberately limited to represention of data, with no functions for data analysis or visualization.\n\nNeo is used by a number of other software tools, including SpykeViewer (data analysis and visualization), Elephant (data analysis), the G-node suite (databasing), PyNN (simulations), tridesclous_ (spike sorting) and ephyviewer (data visualization).\n\nNeo implements a hierarchical data model well adapted to intracellular and extracellular electrophysiology and EEG data with support for multi-electrodes (for example tetrodes). Neo's data objects build on the quantities package, which in turn builds on NumPy by adding support for physical dimensions. Thus Neo objects behave just like normal NumPy arrays, but with additional metadata, checks for dimensional consistency and automatic unit conversion.",
1414
"applicationCategory": "neuroscience",
15-
"releaseNotes": "https://neo.readthedocs.io/en/stable/releases/0.13.2.html",
15+
"releaseNotes": "https://neo.readthedocs.io/en/stable/releases/0.13.3.html",
1616
"funding": "https://cordis.europa.eu/project/id/945539",
1717
"developmentStatus": "active",
1818
"referencePublication": "https://doi.org/10.3389/fninf.2014.00010",

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/brainvisionrawio.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,22 @@ def _parse_header(self):
9494
channel_desc = channel_infos[f"Ch{c+1}"]
9595
except KeyError:
9696
channel_desc = channel_infos[f"ch{c + 1}"]
97-
name, ref, res, units = channel_desc.split(",")
98-
units = units.replace("µ", "u")
97+
# split up channel description, handling default values
98+
cds = channel_desc.split(",")
99+
name = cds[0]
100+
if len(cds) >= 2:
101+
ref = cds[1]
102+
else:
103+
ref = ""
104+
if len(cds) >= 3:
105+
res = cds[2]
106+
else:
107+
res = "1.0"
108+
if len(cds) == 4:
109+
units = cds[3]
110+
else:
111+
units = "u"
112+
units = units.replace("µ", "u") # Brainvision spec for specific unicode
99113
chan_id = str(c + 1)
100114
if sig_dtype == np.int16 or sig_dtype == np.int32:
101115
gain = float(res)

neo/rawio/intanrawio.py

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

182182
# for 'one-file-per-signal' we have one memory map / neo stream
183+
# based on https://github.com/NeuralEnsemble/python-neo/issues/1556 bug in versions 0.13.1, .2, .3
183184
elif self.file_format == "one-file-per-signal":
184185
self._raw_data = {}
185186
for stream_index, (stream_index_key, stream_datatype) in enumerate(memmap_data_dtype.items()):
@@ -189,8 +190,12 @@ def _parse_header(self):
189190
dtype_size = np.dtype(stream_datatype).itemsize
190191
n_samples = size_in_bytes // (dtype_size * num_channels)
191192
signal_stream_memmap = np.memmap(
192-
file_path, dtype=stream_datatype, mode="r", shape=(num_channels, n_samples)
193-
).T
193+
file_path,
194+
dtype=stream_datatype,
195+
mode="r",
196+
shape=(n_samples, num_channels),
197+
order="C",
198+
)
194199
self._raw_data[stream_index] = signal_stream_memmap
195200

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

0 commit comments

Comments
 (0)