Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #736.
Problem
In
spike_time_tiling_coefficient,run_ptests whether a spike lies within ±dt of a spike of the other train withnp.isclose(..., atol=dt). With the defaultrtol=1e-5, the test is|t_j - t_i| <= dt + 1e-5 * |t_i|, so the coincidence window grows with the absolute spike time (5.2 ms instead of 5 ms at t = 20 s for dt = 5 ms). The STTC of two spike trains then changes when both are shifted in time, and P is computed with a wider window than T.Change
elephant/spike_train_correlation.py: passrtol=0tonp.iscloseinrun_p, so the window is exactly ±dt.elephant/test/test_spike_train_correlation.py: addtest_sttc_window_independent_of_spike_time, which checks that two spikes 5.1 ms apart are not coincident for dt = 5 ms, both at t = 1 s and at t = 20 s.Tests
Run locally on Elephant 1.2.1 with the change applied:
SpikeTimeTilingCoefficientTestCasepass, includingtest_sttc_validation_testagainst the original C implementation;test_spike_train_correlation.pypass.