NeuralAnalysis / PyalData

Repository for the Python implementation of the TrialData analysis library.
GNU General Public License v3.0
7 stars 9 forks source link

Handle slicing problems better #73

Closed bagibence closed 3 years ago

bagibence commented 3 years ago

@babaf raised this issue on Teams:

if time slicing doesn't work, what is the default behaviour? it seems as if trials where slicing didn't work have zero entries then in the time dimension.... I would suggest maybe exclude them directly, and give notice?

I'll address this inside restrict_to_interval

bagibence commented 3 years ago

@babaf @catiafortunato can you check if this works for you and behaves how you would expect?

babaf commented 3 years ago

The slicing works now. But one potential thing missing now is how to solve if you want to take the same data (same trials), but look at different intervals. It could now be that for some intervals there are less trials compared to others, which is a bit inconvenient... Sorry as it is basically going against what I suggested in the beginning :P Maybe we should keep the 'bad' trials, but created a new column indicating them? Or have an option to do either the one or the other? I'm not sure what's best..

bagibence commented 3 years ago

If your interval was out of range for a trial, it doesn't have any values now and you can't use that even if it wasn't dropped, right? If you're extracting two intervals and want to know which trials were dropped you can just look at the warning. If you want to take the trials that have both intervals, you could take the intersection of trial IDs in the two resulting dataframes. Or am I missing something?

bagibence commented 3 years ago

I'll just merge this.