Skip to content

Commit

Permalink
remove pool_trials arg
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz-Alexander-Kern committed Dec 10, 2024
1 parent 303f363 commit e9e6778
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions elephant/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,16 +366,12 @@ def _compute_fano(spiketrains: Union[List[neo.SpikeTrain], List[pq.Quantity], Li
return spike_counts.var()/spike_counts.mean()

if isinstance(spiketrains, elephant.trials.Trials):
if not pool_trials:
return [[_compute_fano([spiketrain]) for spiketrain in spiketrains.get_spiketrains_from_trial_as_list(idx)]
for idx in range(spiketrains.n_trials)]
elif pool_trials:
list_of_lists_of_spiketrains = [
spiketrains.get_spiketrains_from_trial_as_list(trial_id=trial_no)
for trial_no in range(spiketrains.n_trials)]
return [_compute_fano([list_of_lists_of_spiketrains[trial_no][st_no]
for trial_no in range(len(list_of_lists_of_spiketrains))])
for st_no in range(len(list_of_lists_of_spiketrains[0]))]
list_of_lists_of_spiketrains = [
spiketrains.get_spiketrains_from_trial_as_list(trial_id=trial_no)
for trial_no in range(spiketrains.n_trials)]
return [_compute_fano([list_of_lists_of_spiketrains[trial_no][st_no]
for trial_no in range(len(list_of_lists_of_spiketrains))])
for st_no in range(len(list_of_lists_of_spiketrains[0]))]
else: # Legacy behavior
return _compute_fano(spiketrains)

Expand Down

0 comments on commit e9e6778

Please sign in to comment.