Skip to content

Commit b34eae5

Browse files
authored
Merge branch 'master' into issue1530
2 parents 016d6ee + 332d69d commit b34eae5

29 files changed

+719
-135
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'

README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ grant agreement FETPI-015879 (FACETS), by the European Union Seventh Framework P
6464
under grant agreements no. 269921 (BrainScaleS) and no. 604102 (HBP),
6565
and by the European Union’s Horizon 2020 Framework Programme for
6666
Research and Innovation under the Specific Grant Agreements No. 720270 (Human Brain Project SGA1),
67-
No. 785907 (Human Brain Project SGA2) and No. 945539 (Human Brain Project SGA3).
67+
No. 785907 (Human Brain Project SGA2) and No. 945539 (Human Brain Project SGA3),
68+
and by the European Union's Research and Innovation Program Horizon Europe Grant Agreement No. 101147319 (EBRAINS 2.0).
6869

6970
.. _OpenElectrophy: https://github.com/OpenElectrophy/OpenElectrophy
7071
.. _Elephant: http://neuralensemble.org/elephant

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",

doc/source/releases.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Release notes
66
.. toctree::
77
:maxdepth: 1
88

9+
releases/0.13.3.rst
910
releases/0.13.2.rst
1011
releases/0.13.1.rst
1112
releases/0.13.0.rst

doc/source/releases/0.13.3.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
========================
2+
Neo 0.13.3 release notes
3+
========================
4+
5+
28 August 2024
6+
7+
This release of Neo contains bug fixes, still with a focus on the planned 1.0 release,
8+
and will be the last release not to support NumPy 2.0.
9+
10+
See all `pull requests`_ included in this release and the `list of closed issues`_.
11+
12+
13+
Updated dependencies
14+
--------------------
15+
16+
Neo has a limit of NumPy >= 1.19.5, < 2.0.0 and Quantities >= 14.0.1, < 0.16.0
17+
18+
19+
Bug fixes and improvements in IO modules
20+
----------------------------------------
21+
22+
Bug fixes and/or improvements have been made to :class:`PlexonIO`, :class:`SpikeGLXIO`,
23+
:class:`BiocamIO`.
24+
25+
Acknowledgements
26+
----------------
27+
28+
Thanks to Zach McKenzie, Heberto Mayorquin, and Alessio Buccino for their contributions to this release.
29+
30+
31+
.. _`pull requests`: https://github.com/NeuralEnsemble/python-neo/pulls?q=is%3Apr+is%3Aclosed+milestone%3A0.13.3
32+
33+
.. _`list of closed issues`: https://github.com/NeuralEnsemble/python-neo/issues?q=is%3Aissue+is%3Aclosed+milestone%3A0.13.3

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,28 +136,36 @@ def _get_analogsignal_chunk(self, block_index, seg_index, i_start, i_stop, strea
136136

137137
# newer style data returns an initial flat array (n_samples * n_channels)
138138
# we iterate through channels rather than slicing
139+
# Due to the fact that Neo and SpikeInterface tend to prefer slices we need to add
140+
# some careful checks around slicing of None in the case we need to iterate through
141+
# channels. First check if None. Then check if slice and only if slice check that it is slice(None)
139142
else:
140143
if channel_indexes is None:
141144
channel_indexes = [ch for ch in range(self._num_channels)]
145+
elif isinstance(channel_indexes, slice):
146+
start = channel_indexes.start or 0
147+
stop = channel_indexes.stop or self._num_channels
148+
step = channel_indexes.step or 1
149+
channel_indexes = [ch for ch in range(start, stop, step)]
142150

143-
sig_chunk = np.zeros((i_stop-i_start, len(channel_indexes)))
151+
sig_chunk = np.zeros((i_stop - i_start, len(channel_indexes)), dtype=data.dtype)
144152
# iterate through channels to prevent loading all channels into memory which can cause
145153
# memory exhaustion. See https://github.com/SpikeInterface/spikeinterface/issues/3303
146154
for index, channel_index in enumerate(channel_indexes):
147-
sig_chunk[:, index] = data[channel_index::self._num_channels]
155+
sig_chunk[:, index] = data[channel_index :: self._num_channels]
148156

149157
return sig_chunk
150158

151159

152-
def open_biocam_file_header(filename)-> dict:
160+
def open_biocam_file_header(filename) -> dict:
153161
"""Open a Biocam hdf5 file, read and return the recording info, pick the correct method to access raw data,
154162
and return this to the caller
155-
163+
156164
Parameters
157165
----------
158166
filename: str
159167
The file to be parsed
160-
168+
161169
Returns
162170
-------
163171
dict
@@ -244,7 +252,7 @@ def open_biocam_file_header(filename)-> dict:
244252
num_channels_x = num_channels_y = int(np.sqrt(num_channels))
245253
else:
246254
raise NeoReadWriteError("No Well found in the file")
247-
255+
248256
if num_channels_x * num_channels_y != num_channels:
249257
raise NeoReadWriteError(f"Cannot determine structure of the MEA plate with {num_channels} channels")
250258
channels = 1 + np.concatenate(np.transpose(np.meshgrid(range(num_channels_x), range(num_channels_y))))
@@ -268,6 +276,7 @@ def open_biocam_file_header(filename)-> dict:
268276
######################################################################
269277
# Helper functions to obtain the raw data split by Biocam version.
270278

279+
271280
# return the full array for the old datasets
272281
def readHDF5t_100(rf, t0, t1, nch):
273282
return rf["3BData/Raw"][t0:t1]

neo/rawio/blackrockrawio.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,8 @@ def __read_nsx_dataheader_variant_c(
986986
index = 0
987987

988988
if offset is None:
989-
offset = self.__nsx_basic_header[nsx_nb]["bytes_in_headers"]
989+
# This is read as an uint32 numpy scalar from the header so we transform it to python int
990+
offset = int(self.__nsx_basic_header[nsx_nb]["bytes_in_headers"])
990991

991992
ptp_dt = [
992993
("reserved", "uint8"),

0 commit comments

Comments
 (0)