Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spikes filter range should be exclusive of the end point #270

Open
dkeller9 opened this issue Sep 4, 2024 · 3 comments
Open

Spikes filter range should be exclusive of the end point #270

dkeller9 opened this issue Sep 4, 2024 · 3 comments

Comments

@dkeller9
Copy link

dkeller9 commented Sep 4, 2024

It might be better if the filter operation does not include the end point of the range. For example, the command:

filtered = spikes.filter(group={'layer':'SP'}, t_start=1, t_stop=100)

will also return spikes happening exactly at t=100. Probably many users would find it more intuitive if the start point but not the end point was included in the range.

@mgeplf
Copy link
Contributor

mgeplf commented Sep 4, 2024

I agree! This is a wart in the API that's always bugged me.
Sadly, this was inherited from how the initial report reading was done, and it's propagated since then.
Unfortunately it's not something we can change, as people's analysis would change; we have to keep a stable API.

@dkeller9
Copy link
Author

dkeller9 commented Sep 4, 2024

Perhaps adding a new filter called "filter_exclusive" would preserve earlier analyses and do things according to convention.

@mgeplf
Copy link
Contributor

mgeplf commented Sep 4, 2024

That's an idea.
I don't normally like to add parameters to a function, but in this case the correct (in your and my opinion :)) behavior is exclusive_endpoint=True, but it could be added and set to False by default, preserving the old behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants