You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When passing a more than 0-dimensional sigma in the generation of a kernel and using said kernel to calculate the instantaneous firing rate an error is raised somewhere in fftconvolve.
To Reproduce
import neo
import elephant
import quantities as pq
st = neo.SpikeTrain([1]*pq.s, t_stop=2*pq.s)
kernel = elephant.kernels.GaussianKernel(sigma=[20]*pq.ms)
rate = elephant.statistics.instantaneous_rate(st,
sampling_period=1*pq.ms,
kernel=kernel)
returns
Traceback (most recent call last):
File "reproduce_sigma_error.py", line 9, in <module>
rate = elephant.statistics.instantaneous_rate(st,
File "/home/kleinjohann/software/elephant/elephant/utils.py", line 79, in wrapper
return func(*args, **kwargs)
File "/home/kleinjohann/software/elephant/elephant/statistics.py", line 868, in instantaneous_rate
rate = scipy.signal.fftconvolve(time_vectors,
File "/home/kleinjohann/software/miniconda3/envs/elephant/lib/python3.8/site-packages/scipy/signal/signaltools.py", line 525, in fftconvolve
raise ValueError("in1 and in2 should have the same dimensionality")
ValueError: in1 and in2 should have the same dimensionality
where t_arr gains an extra dimension since cutoff_sigma keeps the extra dimension of sigma.
Expected behavior
Either a more helpful error should be raised which tells me to fix the dimensionality of sigma, or different dimensionalities should be accounted for internally and no error should be raised.
Describe the bug
When passing a more than 0-dimensional
sigma
in the generation of a kernel and using said kernel to calculate the instantaneous firing rate an error is raised somewhere infftconvolve
.To Reproduce
returns
I tracked this down to
elephant/elephant/statistics.py
Line 852 in d0d3920
where
t_arr
gains an extra dimension sincecutoff_sigma
keeps the extra dimension ofsigma
.Expected behavior
Either a more helpful error should be raised which tells me to fix the dimensionality of
sigma
, or different dimensionalities should be accounted for internally and no error should be raised.Environment
neo
python package version: 0.9.0elephant
version: d0d3920scipy
version: 1.5.4The text was updated successfully, but these errors were encountered: