Skip to content

Commit

Permalink
remove user warning to manually check duration for numpy arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz-Alexander-Kern committed Dec 10, 2024
1 parent 5b1cf75 commit 303f363
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
4 changes: 0 additions & 4 deletions elephant/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,6 @@ def _check_input_spiketrains_durations(spiketrains: Union[List[neo.SpikeTrain],
warnings.warn(f"Fano factor calculated for spike trains of "
f"different duration (minimum: {np.min(durations)}s, maximum "
f"{np.max(durations)}s).")
else:
warnings.warn(f"Spiketrains was of type {type(spiketrains)}, which does not support automatic duration"
f"check. The parameter 'warn_tolerance' will have no effect. Please ensure manually that"
f"all spike trains have the same duration.")

def _compute_fano(spiketrains: Union[List[neo.SpikeTrain], List[pq.Quantity], List[np.ndarray]]) -> float:
# Check spike train durations
Expand Down
5 changes: 0 additions & 5 deletions elephant/test/test_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,6 @@ def test_fanofactor_trials_pool_spike_trains_wrong_type(self):
self.assertRaises(TypeError, statistics.fanofactor, self.test_trials, pool_spike_trials="Wrong Type",
pool_spike_trains="Wrong Type")

def test_fanofactor_warn_durations_manual_check(self):
st1 = [1, 2, 3] * pq.s
st2 = [1, 2, 3] * pq.s
self.assertWarns(UserWarning, statistics.fanofactor, (st1, st2))


class LVTestCase(unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit 303f363

Please sign in to comment.