From ecd689b913dae7c367539a25d36e4555332013d6 Mon Sep 17 00:00:00 2001 From: Jacob Woessner Date: Mon, 16 Dec 2024 17:49:16 -0600 Subject: [PATCH] Revert "Move erp functions and tests" This reverts commit e4e332c82866e7ea498492518e4137569a01ecca. --- mne/stats/tests/test_erp.py | 66 +------------------------------------ 1 file changed, 1 insertion(+), 65 deletions(-) diff --git a/mne/stats/tests/test_erp.py b/mne/stats/tests/test_erp.py index 712cffa2f43..d0dea27f43c 100644 --- a/mne/stats/tests/test_erp.py +++ b/mne/stats/tests/test_erp.py @@ -8,13 +8,7 @@ from mne import Epochs, read_events from mne.io import read_raw_fif -from mne.stats.erp import ( - compute_sme, - get_peak, - get_area, - get_frac_peak_latency, - get_frac_area_latency, -) +from mne.stats.erp import compute_sme base_dir = Path(__file__).parents[2] / "io" / "tests" / "data" raw = read_raw_fif(base_dir / "test_raw.fif") @@ -25,7 +19,6 @@ def test_compute_sme(): """Test SME computation.""" epochs = Epochs(raw, events) sme = compute_sme(epochs, start=0, stop=0.1) - print(sme) assert sme.shape == (376,) with pytest.raises(TypeError, match="int or float"): @@ -36,60 +29,3 @@ def test_compute_sme(): compute_sme(epochs, -1.2, 0.3) with pytest.raises(ValueError, match="out of bounds"): compute_sme(epochs, -0.1, 0.8) - - -def test_get_peak(): - """Test peak computation.""" - epochs = Epochs(raw, events) - evoked = epochs.average() - peak_df = get_peak(evoked, tmin=0, tmax=0.1) - evoked_pos = evoked.copy() - evoked_pos.data = abs(evoked_pos.data) - get_peak(evoked_pos, tmin=0, tmax=0.1, mode="neg", strict=False) - - evoked_neg = evoked.copy() - evoked_neg.data = -abs(evoked_neg.data) - get_peak(evoked_neg, tmin=0, tmax=0.1, mode="pos", strict=False) - - assert peak_df.shape == (366, 3) - - with pytest.raises(ValueError, match="No negative values encountered"): - evoked_pos.data = abs(evoked_pos.data) - get_peak(evoked_pos, tmin=0, tmax=0.1, mode="neg", strict=True) - with pytest.raises(ValueError, match="No positive values encountered"): - get_peak(evoked_neg, tmin=0, tmax=0.1, mode="pos", strict=True) - - -def test_get_area(): - """Test area computation.""" - epochs = Epochs(raw, events) - evoked = epochs.average() - area_df = get_area(evoked, tmin=0, tmax=0.1) - assert area_df.shape == (366, 2) - - -def test_get_frac_peak_latency(): - """Test fractional peak latency computation.""" - epochs = Epochs(raw, events) - evoked = epochs.average() - frac_peak_df = get_frac_peak_latency(evoked, frac=0.5, tmin=0, tmax=0.1) - assert frac_peak_df.shape == (366, 4) - - with pytest.raises(ValueError, match="No negative values encountered"): - evoked_pos = evoked.copy() - evoked_pos.data = abs(evoked_pos.data) - get_frac_peak_latency(evoked, frac=0.5, tmin=0, - tmax=0.1, mode="neg", strict=True) - with pytest.raises(ValueError, match="No positive values encountered"): - evoked_neg = evoked.copy() - evoked_neg.data = -abs(evoked_neg.data) - get_frac_peak_latency(evoked, frac=0.5, tmin=0, - tmax=0.1, mode="pos", strict=True) - - -def test_get_frac_area_latency(): - """Test fractional area latency computation.""" - epochs = Epochs(raw, events) - evoked = epochs.average() - frac_area_df = get_frac_area_latency(evoked, frac=0.5, tmin=0, tmax=0.1) - assert frac_area_df.shape == (366, 3)