Skip to content

Commit b2d49e9

Browse files
authored
Merge branch 'master' into issue799
2 parents b60b84a + 79df3c8 commit b2d49e9

39 files changed

+140
-140
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ workflows:
77
version: 2
88
test:
99
jobs:
10-
- test-3.7
10+
- test-3.8
1111
jobs:
12-
test-3.7:
12+
test-3.8:
1313
docker:
14-
- image: circleci/python:3.7.7
14+
- image: circleci/python:3.8.5
1515

1616
environment:
1717
- NEO_TEST_FILE_DIR: "/home/circleci/repo/files_for_testing_neo"

.circleci/requirements_testing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
scipy>=0.12.0
1+
scipy>=1.0.0
22
h5py
33
igor
44
klusta

.travis.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ sudo: false
44

55
matrix:
66
include:
7-
- python: "3.5"
8-
env: NUMPY_VERSION="1.11.3"
9-
- python: "3.5"
10-
env: NUMPY_VERSION="1.18.3"
117
- python: "3.6"
12-
env: NUMPY_VERSION="1.12.1"
8+
env: NUMPY_VERSION="1.14.6"
139
- python: "3.6"
1410
env: NUMPY_VERSION="1.18.3"
1511
- python: "3.7"
16-
env: NUMPY_VERSION="1.14.5"
12+
env: NUMPY_VERSION="1.14.6"
1713
- python: "3.7"
14+
env: NUMPY_VERSION="1.19.2"
15+
- python: "3.8"
16+
env: NUMPY_VERSION="1.14.6"
17+
- python: "3.8"
1818
env: NUMPY_VERSION="1.15.4"
19-
- python: "3.7"
19+
- python: "3.8"
2020
env: NUMPY_VERSION="1.16.6"
21-
- python: "3.7"
21+
- python: "3.8"
2222
env: NUMPY_VERSION="1.17.5"
23-
- python: "3.7"
24-
env: NUMPY_VERSION="1.18.3"
2523
- python: "3.8"
26-
env: NUMPY_VERSION="1.18.3"
24+
env: NUMPY_VERSION="1.18.5"
25+
- python: "3.8"
26+
env: NUMPY_VERSION="1.19.2"
2727

2828
# command to install dependencies
2929
before_install:

doc/source/core.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,14 @@ These relationships are bi-directional, i.e. a child object can access its paren
117117
Here is an example showing these relationships in use::
118118

119119
from neo.io import AxonIO
120-
import urllib
120+
import urllib.request
121121
url = "https://web.gin.g-node.org/NeuralEnsemble/ephy_testing_data/raw/master/axon/File_axon_3.abf"
122122
filename = './test.abf'
123-
urllib.urlretrieve(url, filename)
123+
urllib.request.urlretrieve(url, filename)
124124

125125
r = AxonIO(filename=filename)
126-
bl = r.read() # read the entire file > a Block
126+
blocks = r.read() # read the entire file > a list of Blocks
127+
bl = blocks[0]
127128
print(bl)
128129
print(bl.segments) # child access
129130
for seg in bl.segments:

doc/source/install.rst

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,52 @@ Installation
55
Neo is a pure Python package, so it should be easy to get it running on any
66
system.
77

8+
Installing from the Python Package Index
9+
========================================
10+
811
Dependencies
9-
============
12+
------------
1013

11-
* Python_ >= 3.5
12-
* numpy_ >= 1.11.0
14+
* Python_ >= 3.6
15+
* numpy_ >= 1.13.0
1316
* quantities_ >= 0.12.1
1417

15-
For Debian/Ubuntu, you can install these using::
16-
17-
$ apt-get install python-numpy python-pip
18-
$ pip install quantities
18+
You can install the latest published version of Neo and its dependencies using::
1919

20-
You may need to run these as root. For other operating systems, you can
21-
download installers from the links above, or use a scientific Python distribution
22-
such as Anaconda_.
20+
$ pip install neo
2321

2422
Certain IO modules have additional dependencies. If these are not satisfied,
2523
Neo will still install but the IO module that uses them will fail on loading:
2624

27-
* scipy >= 0.12.0 for NeoMatlabIO
25+
* scipy >= 1.0.0 for NeoMatlabIO
2826
* h5py >= 2.5 for Hdf5IO, KwikIO
2927
* klusta for KwikIO
3028
* igor >= 0.2 for IgorIO
3129
* nixio >= 1.5 for NixIO
3230
* stfio for StimfitIO
3331
* pillow for TiffIO
3432

33+
These dependencies can be installed by specifying a comma seperated list on the
34+
``pip install`` command::
3535

36-
Installing from the Python Package Index
37-
========================================
36+
$ pip install neo[hdf5io,tiffio]
3837

39-
.. warning:: alpha and beta releases cannot be installed from PyPI.
38+
Or when installing a specific version of neo::
4039

41-
If you have pip_ installed::
40+
$ pip install neo[hdf5io,tiffio]==0.8.0
4241

43-
$ pip install neo
42+
These additional dependencies for IO modules are available::
43+
44+
* hdf5io
45+
* igorproio
46+
* kwikio
47+
* neomatlabio
48+
* nixio
49+
* stimfitio
50+
* tiffio
4451

45-
This will automatically download and install the latest release (again
46-
you may need to have administrator privileges on the machine you are installing
47-
on).
4852

49-
To download and install manually, download:
53+
To download and install the package manually, download:
5054

5155
|neo_github_url|
5256

@@ -60,14 +64,6 @@ Then:
6064
$ python setup.py install
6165
6266
63-
64-
or::
65-
66-
$ python3 setup.py install
67-
68-
depending on which version of Python you are using.
69-
70-
7167
Installing from source
7268
======================
7369

neo/core/analogsignal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ def _pp(line):
443443
with pp.group(indent=1):
444444
pp.text(line)
445445

446-
for line in ["sampling rate: {}".format(self.sampling_rate),
447-
"time: {} to {}".format(self.t_start, self.t_stop)]:
446+
for line in ["sampling rate: {!s}".format(self.sampling_rate),
447+
"time: {!s} to {!s}".format(self.t_start, self.t_stop)]:
448448
_pp(line)
449449

450450
def time_index(self, t):

neo/core/dataobject.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,6 @@ def _get_arr_ann_length(self):
331331
length = 1
332332
return length
333333

334-
def duplicate_with_new_array(self, signal, units=None):
335-
warnings.warn("Use of the `duplicate_with_new_array function is deprecated. "
336-
"Please use `duplicate_with_new_data` instead.",
337-
DeprecationWarning)
338-
return self.duplicate_with_new_data(signal, units=units)
339-
340334
def __deepcopy__(self, memo):
341335
"""
342336
Create a deep copy of the data object.

neo/core/imagesequence.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ def _pp(line):
205205
pp.text(line)
206206

207207
for line in [
208-
"sampling rate: {}".format(self.sampling_rate),
209-
"spatial_scale: {}".format(self.spatial_scale),
208+
"sampling rate: {!s}".format(self.sampling_rate),
209+
"spatial_scale: {!s}".format(self.spatial_scale),
210210
]:
211211
_pp(line)
212212

neo/core/spiketrain.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,13 @@ def time_slice(self, t_start, t_stop):
599599
_t_start = -np.inf
600600
if t_stop is None:
601601
_t_stop = np.inf
602+
603+
if _t_start > self.t_stop or _t_stop < self.t_start:
604+
# the alternative to raising an exception would be to return
605+
# a zero-duration spike train set at self.t_stop or self.t_start
606+
raise ValueError("A time slice completely outside the "
607+
"boundaries of the spike train is not defined.")
608+
602609
indices = (self >= _t_start) & (self <= _t_stop)
603610

604611
# Time slicing should create a deep copy of the object

neo/io/asciiimageio.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ def __init__(self, file_name=None, nb_frame=None, nb_row=None, nb_column=None, u
5656
self.sampling_rate = sampling_rate
5757
self.spatial_scale = spatial_scale
5858

59-
def read(self, lazy=False, **kwargs):
60-
if lazy:
61-
raise ValueError('This IO module does not support lazy loading')
62-
return [self.read_block(lazy=lazy, **kwargs)]
63-
6459
def read_block(self, lazy=False, **kwargs):
6560

6661
file = open(self.filename, 'r')

0 commit comments

Comments
 (0)