elephant
elephant copied to clipboard
Fix/onedimensional sigma
This PR addresses Issue #455 .
Changes
- check dimensions of sigma, if dimension > 0 , raise
typeError
- handle unambiguous case
ndim=1
,size = 1
withsigma = sigma[0]
- added tests for both above cases
Test
The following code snippet should no longer throw an error
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)