diff options
Diffstat (limited to 'pyspike')
-rw-r--r-- | pyspike/DiscreteFunc.py | 6 | ||||
-rw-r--r-- | pyspike/PieceWiseConstFunc.py | 8 | ||||
-rw-r--r-- | pyspike/PieceWiseLinFunc.py | 8 | ||||
-rw-r--r-- | pyspike/cython/cython_add.pyx | 1 | ||||
-rw-r--r-- | pyspike/cython/cython_directionality.pyx | 1 | ||||
-rw-r--r-- | pyspike/cython/cython_distances.pyx | 1 | ||||
-rw-r--r-- | pyspike/cython/cython_profiles.pyx | 1 | ||||
-rw-r--r-- | pyspike/cython/cython_simulated_annealing.pyx | 1 |
8 files changed, 16 insertions, 11 deletions
diff --git a/pyspike/DiscreteFunc.py b/pyspike/DiscreteFunc.py index caad290..48bc787 100644 --- a/pyspike/DiscreteFunc.py +++ b/pyspike/DiscreteFunc.py @@ -5,7 +5,7 @@ from __future__ import absolute_import, print_function import numpy as np -import collections +import collections.abc import pyspike @@ -155,11 +155,11 @@ class DiscreteFunc(object): multiplicity = np.sum(self.mp[1:-1]) else: # check if interval is as sequence - assert isinstance(interval, collections.Sequence), \ + assert isinstance(interval, collections.abc.Sequence), \ "Invalid value for `interval`. None, Sequence or Tuple \ expected." # check if interval is a sequence of intervals - if not isinstance(interval[0], collections.Sequence): + if not isinstance(interval[0], collections.abc.Sequence): # find the indices corresponding to the interval start_ind, end_ind = get_indices(interval) value = np.sum(self.y[start_ind:end_ind]) diff --git a/pyspike/PieceWiseConstFunc.py b/pyspike/PieceWiseConstFunc.py index 17fdd3f..e33c61d 100644 --- a/pyspike/PieceWiseConstFunc.py +++ b/pyspike/PieceWiseConstFunc.py @@ -5,7 +5,7 @@ from __future__ import absolute_import, print_function import numpy as np -import collections +import collections.abc import pyspike @@ -39,7 +39,7 @@ class PieceWiseConstFunc(object): ind = np.searchsorted(self.x, t, side='right') - if isinstance(t, collections.Sequence): + if isinstance(t, collections.abc.Sequence): # t is a sequence of values # correct the cases t == x[0], t == x[-1] ind[ind == 0] = 1 @@ -173,10 +173,10 @@ class PieceWiseConstFunc(object): return self.integral() / (self.x[-1]-self.x[0]) # check if interval is as sequence - assert isinstance(interval, collections.Sequence), \ + assert isinstance(interval, collections.abc.Sequence), \ "Invalid value for `interval`. None, Sequence or Tuple expected." # check if interval is a sequence of intervals - if not isinstance(interval[0], collections.Sequence): + if not isinstance(interval[0], collections.abc.Sequence): # just one interval a = self.integral(interval) / (interval[1]-interval[0]) else: diff --git a/pyspike/PieceWiseLinFunc.py b/pyspike/PieceWiseLinFunc.py index 8faaec4..b3b503b 100644 --- a/pyspike/PieceWiseLinFunc.py +++ b/pyspike/PieceWiseLinFunc.py @@ -5,7 +5,7 @@ from __future__ import absolute_import, print_function import numpy as np -import collections +import collections.abc import pyspike @@ -46,7 +46,7 @@ class PieceWiseLinFunc: ind = np.searchsorted(self.x, t, side='right') - if isinstance(t, collections.Sequence): + if isinstance(t, collections.abc.Sequence): # t is a sequence of values # correct the cases t == x[0], t == x[-1] ind[ind == 0] = 1 @@ -211,10 +211,10 @@ class PieceWiseLinFunc: return self.integral() / (self.x[-1]-self.x[0]) # check if interval is as sequence - assert isinstance(interval, collections.Sequence), \ + assert isinstance(interval, collections.abc.Sequence), \ "Invalid value for `interval`. None, Sequence or Tuple expected." # check if interval is a sequence of intervals - if not isinstance(interval[0], collections.Sequence): + if not isinstance(interval[0], collections.abc.Sequence): # just one interval a = self.integral(interval) / (interval[1]-interval[0]) else: diff --git a/pyspike/cython/cython_add.pyx b/pyspike/cython/cython_add.pyx index 25f1181..f38406a 100644 --- a/pyspike/cython/cython_add.pyx +++ b/pyspike/cython/cython_add.pyx @@ -1,3 +1,4 @@ +#cython: language_level=3 #cython: boundscheck=False #cython: wraparound=False #cython: cdivision=True diff --git a/pyspike/cython/cython_directionality.pyx b/pyspike/cython/cython_directionality.pyx index ac37690..40450cd 100644 --- a/pyspike/cython/cython_directionality.pyx +++ b/pyspike/cython/cython_directionality.pyx @@ -1,3 +1,4 @@ +#cython: language_level=3 #cython: boundscheck=False #cython: wraparound=False #cython: cdivision=True diff --git a/pyspike/cython/cython_distances.pyx b/pyspike/cython/cython_distances.pyx index d4070ae..f049718 100644 --- a/pyspike/cython/cython_distances.pyx +++ b/pyspike/cython/cython_distances.pyx @@ -1,3 +1,4 @@ +#cython: language_level=3 #cython: boundscheck=False #cython: wraparound=False #cython: cdivision=True diff --git a/pyspike/cython/cython_profiles.pyx b/pyspike/cython/cython_profiles.pyx index aa24db4..a83e4f7 100644 --- a/pyspike/cython/cython_profiles.pyx +++ b/pyspike/cython/cython_profiles.pyx @@ -1,3 +1,4 @@ +#cython: language_level=3 #cython: boundscheck=False #cython: wraparound=False #cython: cdivision=True diff --git a/pyspike/cython/cython_simulated_annealing.pyx b/pyspike/cython/cython_simulated_annealing.pyx index be9423c..53ecde7 100644 --- a/pyspike/cython/cython_simulated_annealing.pyx +++ b/pyspike/cython/cython_simulated_annealing.pyx @@ -1,3 +1,4 @@ +#cython: language_level=3 #cython: boundscheck=False #cython: wraparound=False #cython: cdivision=True |