@@ -58,7 +58,7 @@ def _generate_signal(fmin, fmax, timepoints, fcount=1):
58
58
def test_bad_by_nan (raw_tmp ):
59
59
"""Test the detection of channels containing any NaN values."""
60
60
# Insert a NaN value into a random channel
61
- n_chans = raw_tmp ._data .shape [0 ]
61
+ n_chans = raw_tmp .get_data () .shape [0 ]
62
62
nan_idx = int (RNG .randint (0 , n_chans , 1 ))
63
63
raw_tmp ._data [nan_idx , 3 ] = np .nan
64
64
@@ -74,9 +74,9 @@ def test_bad_by_nan(raw_tmp):
74
74
def test_bad_by_flat (raw_tmp ):
75
75
"""Test the detection of channels with flat or very weak signals."""
76
76
# Make the signal for a random channel extremely weak
77
- n_chans = raw_tmp ._data .shape [0 ]
77
+ n_chans = raw_tmp .get_data () .shape [0 ]
78
78
flat_idx = int (RNG .randint (0 , n_chans , 1 ))
79
- raw_tmp ._data [flat_idx , :] = raw_tmp ._data [flat_idx , :] * 1e-12
79
+ raw_tmp ._data [flat_idx , :] = raw_tmp .get_data () [flat_idx , :] * 1e-12
80
80
81
81
# Test automatic detection of flat channels on NoisyChannels init
82
82
nd = NoisyChannels (raw_tmp , do_detrend = False )
@@ -99,7 +99,7 @@ def test_bad_by_deviation(raw_tmp):
99
99
high_dev_factor = 4.0
100
100
101
101
# Make the signal for a random channel have a very high amplitude
102
- n_chans = raw_tmp ._data .shape [0 ]
102
+ n_chans = raw_tmp .get_data () .shape [0 ]
103
103
high_dev_idx = int (RNG .randint (0 , n_chans , 1 ))
104
104
raw_tmp ._data [high_dev_idx , :] *= high_dev_factor
105
105
@@ -125,7 +125,7 @@ def test_bad_by_deviation(raw_tmp):
125
125
def test_bad_by_hf_noise (raw_tmp ):
126
126
"""Test detection of channels with high-frequency noise."""
127
127
# Add some noise between 70 & 80 Hz to the signal of a random channel
128
- n_chans = raw_tmp ._data .shape [0 ]
128
+ n_chans = raw_tmp .get_data () .shape [0 ]
129
129
hf_noise_idx = int (RNG .randint (0 , n_chans , 1 ))
130
130
hf_noise = _generate_signal (70 , 80 , raw_tmp .times , 5 ) * 10
131
131
raw_tmp ._data [hf_noise_idx , :] += hf_noise
@@ -147,7 +147,7 @@ def test_bad_by_hf_noise(raw_tmp):
147
147
def test_bad_by_dropout (raw_tmp ):
148
148
"""Test detection of channels with excessive portions of flat signal."""
149
149
# Add large dropout portions to the signal of a random channel
150
- n_chans , n_samples = raw_tmp ._data .shape
150
+ n_chans , n_samples = raw_tmp .get_data () .shape
151
151
dropout_idx = int (RNG .randint (0 , n_chans , 1 ))
152
152
x1 , x2 = (int (n_samples / 10 ), int (2 * n_samples / 10 ))
153
153
raw_tmp ._data [dropout_idx , x1 :x2 ] = 0 # flatten 10% of signal
@@ -161,7 +161,7 @@ def test_bad_by_dropout(raw_tmp):
161
161
def test_bad_by_correlation (raw_tmp ):
162
162
"""Test detection of channels that correlate poorly with others."""
163
163
# Replace a random channel's signal with uncorrelated values
164
- n_chans , n_samples = raw_tmp ._data .shape
164
+ n_chans , n_samples = raw_tmp .get_data () .shape
165
165
low_corr_idx = int (RNG .randint (0 , n_chans , 1 ))
166
166
raw_tmp ._data [low_corr_idx , :] = _generate_signal (10 , 30 , raw_tmp .times , 5 )
167
167
@@ -186,7 +186,7 @@ def test_bad_by_correlation(raw_tmp):
186
186
def test_bad_by_SNR (raw_tmp ):
187
187
"""Test detection of channels that have low signal-to-noise ratios."""
188
188
# Replace a random channel's signal with uncorrelated values
189
- n_chans = raw_tmp ._data .shape [0 ]
189
+ n_chans = raw_tmp .get_data () .shape [0 ]
190
190
low_snr_idx = int (RNG .randint (0 , n_chans , 1 ))
191
191
raw_tmp ._data [low_snr_idx , :] = _generate_signal (10 , 30 , raw_tmp .times , 5 )
192
192
@@ -275,7 +275,7 @@ def test_find_bad_by_ransac_err(raw_tmp):
275
275
nd .find_bad_by_ransac (n_samples = n_samples )
276
276
277
277
# Test IOError when too few good channels for RANSAC sample size
278
- n_chans = raw_tmp ._data .shape [0 ]
278
+ n_chans = raw_tmp .get_data () .shape [0 ]
279
279
nd = NoisyChannels (raw_tmp , do_detrend = False )
280
280
nd .bad_by_deviation = raw_tmp .info ["ch_names" ][0 : int (n_chans * 0.8 )]
281
281
with pytest .raises (IOError ):
0 commit comments