BlueBrain / snap

The Blue Brain Pythonic Simulation and Network Analysis Productivity layer
https://bluebrainsnap.readthedocs.io/
GNU Lesser General Public License v3.0
17 stars 10 forks source link

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

Open dkeller9 opened 2 weeks ago

dkeller9 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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

mgeplf commented 2 weeks ago

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.