diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | pyspike/distances.py | 4 | ||||
-rw-r--r-- | test/test_distance.py | 16 |
3 files changed, 19 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml index cec04c2..d2d1437 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ python: - "2.6" - "2.7" -before_install: +install: - sudo apt-get install -qq cython script: diff --git a/pyspike/distances.py b/pyspike/distances.py index 55515f6..4ba2bd3 100644 --- a/pyspike/distances.py +++ b/pyspike/distances.py @@ -19,7 +19,7 @@ from pyspike import PieceWiseConstFunc, PieceWiseLinFunc def isi_distance(spikes1, spikes2): """ Computes the isi-distance profile S_isi(t) of the two given spike trains. Retruns the profile as a PieceWiseConstFunc object. The S_isi - values are defined in the interval [0,1). The spike trains are expected + values are defined positive S_isi(t)>=0. The spike trains are expected to have auxiliary spikes at the beginning and end of the interval. Use the function add_auxiliary_spikes to add those spikes to the spike train. Args: @@ -46,7 +46,7 @@ def isi_distance(spikes1, spikes2): def spike_distance(spikes1, spikes2): """ Computes the spike-distance profile S_spike(t) of the two given spike trains. Returns the profile as a PieceWiseLinFunc object. The S_spike - values are defined in the interval [0,1). The spike trains are expected to + values are defined positive S_spike(t)>=0. The spike trains are expected to have auxiliary spikes at the beginning and end of the interval. Use the function add_auxiliary_spikes to add those spikes to the spike train. Args: diff --git a/test/test_distance.py b/test/test_distance.py index 6e50467..0695701 100644 --- a/test/test_distance.py +++ b/test/test_distance.py @@ -138,6 +138,22 @@ def test_multi_spike(): check_multi_distance(spk.spike_distance, spk.spike_distance_multi) +def test_regression_spiky(): + spike_trains = spk.load_spike_trains_from_txt("PySpike_testdata.txt", + (0.0, 4000.0)) + isi_profile = spk.isi_distance_multi(spike_trains) + isi_dist = isi_profile.avrg() + print(isi_dist) + # get the full precision from SPIKY + # assert_equal(isi_dist, 0.1832) + + spike_profile = spk.spike_distance_multi(spike_trains) + spike_dist = spike_profile.avrg() + print(spike_dist) + # get the full precision from SPIKY + # assert_equal(spike_dist, 0.2445) + + if __name__ == "__main__": test_isi() test_spike() |