{"action":"created","issue":{"url":"https://api.github.com/repos/kwikteam/phy/issues/565","labels_url":"https://api.github.com/repos/kwikteam/phy/issues/565/labels{/name}","comments_url":"https://api.github.com/repos/kwikteam/phy/issues/565/comments","events_url":"https://api.github.com/repos/kwikteam/phy/issues/565/events","html_url":"https://github.com/kwikteam/phy/issues/565","id":97143712,"number":565,"title":"sampling an interval doesn't work if you don't start at zero","user":{"login":"nsteinme","id":7590975,"avatar_url":"https://avatars.githubusercontent.com/u/7590975?v=3","gravatar_id":"","url":"https://api.github.com/users/nsteinme","html_url":"https://github.com/nsteinme","followers_url":"https://api.github.com/users/nsteinme/followers","following_url":"https://api.github.com/users/nsteinme/following{/other_user}","gists_url":"https://api.github.com/users/nsteinme/gists{/gist_id}","starred_url":"https://api.github.com/users/nsteinme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsteinme/subscriptions","organizations_url":"https://api.github.com/users/nsteinme/orgs","repos_url":"https://api.github.com/users/nsteinme/repos","events_url":"https://api.github.com/users/nsteinme/events{/privacy}","received_events_url":"https://api.github.com/users/nsteinme/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kwikteam/phy/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-24T20:47:15Z","updated_at":"2015-07-25T22:17:52Z","closed_at":null,"body":"Line 97 of detect/spikedetekt.py is a bug: it checks that start is less than n_samples, but if an interval is used, n_samples is the number of samples within the interval whereas start is in absolute samples within the whole file. E.g. if you ask for the interval 9,12 with sample_rate=20000, then start will be 180000 but nsamples will only be 60000, so the assertion will fail though the data and numbers are fine. \r\n\r\nAlso can we clear the NotImplementedError, line 100? I would like to use this function and I don't much care whether the spike times are referenced to the start of the interval or to the start of the total file (in fact maybe the former is preferable?). "},"comment":{"url":"https://api.github.com/repos/kwikteam/phy/issues/comments/124905891","html_url":"https://github.com/kwikteam/phy/issues/565#issuecomment-124905891","issue_url":"https://api.github.com/repos/kwikteam/phy/issues/565","id":124905891,"user":{"login":"rossant","id":1942359,"avatar_url":"https://avatars.githubusercontent.com/u/1942359?v=3","gravatar_id":"","url":"https://api.github.com/users/rossant","html_url":"https://github.com/rossant","followers_url":"https://api.github.com/users/rossant/followers","following_url":"https://api.github.com/users/rossant/following{/other_user}","gists_url":"https://api.github.com/users/rossant/gists{/gist_id}","starred_url":"https://api.github.com/users/rossant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossant/subscriptions","organizations_url":"https://api.github.com/users/rossant/orgs","repos_url":"https://api.github.com/users/rossant/repos","events_url":"https://api.github.com/users/rossant/events{/privacy}","received_events_url":"https://api.github.com/users/rossant/received_events","type":"User","site_admin":false},"created_at":"2015-07-25T22:17:52Z","updated_at":"2015-07-25T22:17:52Z","body":"good catch, it should be `assert 0 <= start < end`, PR welcome :)"}}