Skip to content

Commit 5ccb9d5

Browse files
committed
Merge branch 'master' of https://github.com/NeuralEnsemble/python-neo into spikegadgets_implementation
2 parents 5bac82e + 77455a0 commit 5ccb9d5

File tree

95 files changed

+1848
-1938
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1848
-1938
lines changed

.circleci/config.yml

Lines changed: 0 additions & 75 deletions
This file was deleted.

.github/workflows/full-test.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: neo.io and neo.rawio tests
2+
3+
on:
4+
pull_request:
5+
branches: [master, gh_actions_and_datalad]
6+
types: [synchronize, opened, reopened, ready_for_review]
7+
8+
jobs:
9+
build-and-test:
10+
name: Test on (${{ matrix.os }})
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
# "macos-latest", "windows-latest"
16+
os: ["ubuntu-latest", ]
17+
steps:
18+
- uses: actions/checkout@v2
19+
with:
20+
python-version: 3.8
21+
- name: Get current year-month
22+
id: date
23+
run: echo "::set-output name=date::$(date+'%Y-%m')"
24+
- uses: actions/cache@v2
25+
# the cache for python package is reset:
26+
# * every month
27+
# * when requirements/requirements_testing change
28+
id: cache-venv
29+
with:
30+
path: ~/test_env
31+
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements_testing.txt') }}-${{ steps.date.outputs.date }}
32+
restore-keys: |
33+
${{ runner.os }}-venv-
34+
- name: Install dependencies
35+
run: |
36+
# this is for datalad and download testing datasets
37+
sudo apt install git git-annex
38+
# needed for correct operation of git/git-annex/DataLad
39+
git config --global user.email "neo_ci@fake_mail.com"
40+
git config --global user.name "neo CI"
41+
# create an environment and install everything
42+
python -m venv ~/test_env
43+
source ~/test_env/bin/activate
44+
python -m pip install --upgrade pip
45+
# pip install -r requirements.txt
46+
pip install -r requirements_testing.txt
47+
pip install -e .
48+
- name: Get ephy_testing_data current head hash
49+
# the key depend on the last comit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git
50+
id: vars
51+
run: |
52+
echo "::set-output name=HASH_EPHY_DATASET::$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)"
53+
- uses: actions/cache@v2
54+
id: cache-datasets
55+
with:
56+
path: ~/ephy_testing_data
57+
key: ${{ runner.os }}-datasets-${{ steps.vars.outputs.HASH_EPHY_DATASET }}
58+
restore-keys: |
59+
${{ runner.os }}-datasets
60+
- name: Test with pytest
61+
run: |
62+
source ~/test_env/bin/activate
63+
# only neo.rawio and neo.io
64+
pytest --cov=neo neo/test/rawiotest
65+
pytest --cov=neo neo/test/iotest

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ before_install:
3030
- pip install "numpy==$NUMPY_VERSION"
3131
install:
3232
- pip install -r requirements.txt
33+
- pip install nose
3334
- pip install coveralls
3435
- pip install .
3536
- pip install pillow

doc/source/authors.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ and may not be the current affiliation of a contributor.
5656
* Shashwat Sridhar
5757
* Alessio Buccino [23]
5858
* Regimantas Jurkus [13]
59+
* Steffen Buergers [24]
5960

6061
1. Centre de Recherche en Neuroscience de Lyon, CNRS UMR5292 - INSERM U1028 - Universite Claude Bernard Lyon 1
6162
2. Unité de Neuroscience, Information et Complexité, CNRS UPR 3293, Gif-sur-Yvette, France
@@ -80,6 +81,7 @@ and may not be the current affiliation of a contributor.
8081
21. Institut des Neurosciences Paris-Saclay, CNRS UMR 9197 - Université Paris-Sud, Gif-sur-Yvette, France
8182
22. Neurtex Brain Research Institute, Dallas, TX, USAs
8283
23. Bio Engineering Laboratory, DBSSE, ETH, Basel, Switzerland
84+
24. CatalystNeuro
8385

8486
If we've somehow missed you off the list we're very sorry - please let us know.
8587

neo/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
logging_handler = logging.StreamHandler()
99

1010
from neo.core import *
11-
# ~ import neo.rawio
1211
from neo.io import *
1312

1413
from neo.version import version as __version__

neo/io/__init__.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* :attr:`AsciiSignalIO`
2020
* :attr:`AsciiSpikeTrainIO`
2121
* :attr:`AxographIO`
22+
* :attr:`AxonaIO`
2223
* :attr:`AxonIO`
2324
* :attr:`BCI2000IO`
2425
* :attr:`BlackrockIO`
@@ -41,8 +42,8 @@
4142
* :attr:`NeuroScopeIO`
4243
* :attr:`NeuroshareIO`
4344
* :attr:`NixIO`
44-
* :attr:`NSDFIO`
4545
* :attr:`OpenEphysIO`
46+
* :attr:`OpenEphysBinaryIO`
4647
* :attr:`PhyIO`
4748
* :attr:`PickleIO`
4849
* :attr:`PlexonIO`
@@ -78,6 +79,10 @@
7879
7980
.. autoattribute:: extensions
8081
82+
.. autoclass:: neo.io.AxonaIO
83+
84+
.. autoattribute:: extensions
85+
8186
.. autoclass:: neo.io.AxonIO
8287
8388
.. autoattribute:: extensions
@@ -170,11 +175,11 @@
170175
171176
.. autoattribute:: extensions
172177
173-
.. autoclass:: neo.io.NSDFIO
178+
.. autoclass:: neo.io.OpenEphysIO
174179
175180
.. autoattribute:: extensions
176181
177-
.. autoclass:: neo.io.OpenEphysIO
182+
.. autoclass:: neo.io.OpenEphysBinaryIO
178183
179184
.. autoattribute:: extensions
180185
@@ -255,6 +260,7 @@
255260
from neo.io.asciisignalio import AsciiSignalIO
256261
from neo.io.asciispiketrainio import AsciiSpikeTrainIO
257262
from neo.io.axographio import AxographIO
263+
from neo.io.axonaio import AxonaIO
258264
from neo.io.axonio import AxonIO
259265
from neo.io.blackrockio import BlackrockIO
260266
from neo.io.blkio import BlkIO
@@ -279,8 +285,8 @@
279285
from neo.io.neuroscopeio import NeuroScopeIO
280286
from neo.io.nixio import NixIO
281287
from neo.io.nixio_fr import NixIO as NixIOFr
282-
from neo.io.nsdfio import NSDFIO
283288
from neo.io.openephysio import OpenEphysIO
289+
from neo.io.openephysbinaryio import OpenEphysBinaryIO
284290
from neo.io.phyio import PhyIO
285291
from neo.io.pickleio import PickleIO
286292
from neo.io.plexonio import PlexonIO
@@ -301,6 +307,7 @@
301307
AsciiSignalIO,
302308
AsciiSpikeTrainIO,
303309
AxographIO,
310+
AxonaIO,
304311
AxonIO,
305312
BCI2000IO,
306313
BlackrockIO,
@@ -325,8 +332,8 @@
325332
NeuroExplorerIO,
326333
NeuroScopeIO,
327334
NeuroshareIO,
328-
NSDFIO,
329335
OpenEphysIO,
336+
OpenEphysBinaryIO,
330337
PhyIO,
331338
PickleIO,
332339
PlexonIO,

neo/io/axonaio.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.axonarawio import AxonaRawIO
3+
4+
5+
class AxonaIO(AxonaRawIO, BaseFromRaw):
6+
name = 'Axona IO'
7+
description = "Read raw continuous data (.bin and .set files)"
8+
9+
def __init__(self, filename):
10+
AxonaRawIO.__init__(self, filename=filename)
11+
BaseFromRaw.__init__(self, filename)

neo/io/kwikio.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,12 @@ def read_spiketrain(self, cluster_id, model,
198198
w = pq.Quantity(w, raw_data_units)
199199
else:
200200
w = None
201+
if model.duration > 0.:
202+
t_stop = model.duration
203+
else:
204+
t_stop = np.max(model.spike_times[idx])
201205
sptr = SpikeTrain(times=model.spike_times[idx],
202-
t_stop=model.duration, waveforms=w, units='s',
206+
t_stop=t_stop, waveforms=w, units='s',
203207
sampling_rate=model.sample_rate * pq.Hz,
204208
file_origin=self.filename,
205209
**{'cluster_id': cluster_id})

0 commit comments

Comments
 (0)