nelpy icon indicating copy to clipboard operation
nelpy copied to clipboard

Implement trials

Open jchutrue opened this issue 6 years ago • 5 comments

It's common practice to perform some sort of averaging across or within trials. The concept of trials could be implemented with a dictionary of EpochArray's demarcating the trial boundaries?

jchutrue avatar Apr 29 '19 13:04 jchutrue

I agree that we need trials, but not that they should go in a dictionary. Trials should be smarter than that. We need to come up with a custom container, in my opinion. We can't easily get a subset of trials if it's a dictionary, or total time spent across trials, or whatever else.

I haven't thought about what trial-people want carefully enough, so would definitely welcome lots of discussion. But I feel strongly about it needing to be some kind of custom-built glue or container.

eackermann avatar Apr 29 '19 14:04 eackermann

We can already (albeit hackily) have trial demarcations simply in an epoch array, with which we can then at least do something like

for tt, trial in enumerate(trial_epochs):
    print('this is trial number {}'.format(tt))
    do_func(asa[trial])

whereas this would be much less readable if we had used a dictionary, which also doesn't store trial order.

eackermann avatar Apr 29 '19 14:04 eackermann

Is there an elaboration on how this would work? I'd like to work on this one

kushaangupta avatar Dec 12 '22 20:12 kushaangupta

I think the idea is that a Trial would inherit from EpochArray but add some sort of metadata so that trials with different characteristics. How would having a Trial structure help you? Is there a particular use case?

ckemere avatar Dec 14 '22 01:12 ckemere

Yes, my epoch has different trials A to B to C walks that I want to be able to differentiate among as A to B & B to C. These have some blackout period in between which I need to get rid off too. I thought the trial structure would help, else I'll maybe have to create an EpochArray for each of those segments

kushaangupta avatar Dec 14 '22 01:12 kushaangupta