Skip to content

Commit e71811f

Browse files
committed
FIX: Minor fixes [circle full]
1 parent c6fa82e commit e71811f

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

doc/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@
368368
##############################################################################
369369
# sphinx-gallery
370370

371-
examples_dirs = ['../examples', '../tutorials']
372-
gallery_dirs = ['auto_examples', 'auto_tutorials']
371+
examples_dirs = ['../tutorials', '../examples']
372+
gallery_dirs = ['auto_tutorials', 'auto_examples']
373373
os.environ['_MNE_BUILDING_DOC'] = 'true'
374374

375375
scrapers = ('matplotlib',)

mne/preprocessing/maxwell.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1609,8 +1609,8 @@ def _prep_fine_cal(info, fine_cal):
16091609
from ._fine_cal import read_fine_calibration
16101610
_validate_type(fine_cal, (dict, 'path-like'))
16111611
if not isinstance(fine_cal, dict):
1612-
fine_cal = read_fine_calibration(fine_cal)
16131612
extra = op.basename(str(fine_cal))
1613+
fine_cal = read_fine_calibration(fine_cal)
16141614
else:
16151615
extra = 'dict'
16161616
logger.info(f' Using fine calibration {extra}')

mne/preprocessing/tests/test_maxwell.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -643,9 +643,13 @@ def test_fine_calibration():
643643

644644
# Test 1D SSS fine calibration
645645
with use_coil_def(elekta_def_fname):
646-
raw_sss = maxwell_filter(raw, calibration=fine_cal_fname,
647-
origin=mf_head_origin, regularize=None,
648-
bad_condition='ignore')
646+
with catch_logging() as log:
647+
raw_sss = maxwell_filter(raw, calibration=fine_cal_fname,
648+
origin=mf_head_origin, regularize=None,
649+
bad_condition='ignore', verbose=True)
650+
log = log.getvalue()
651+
assert 'Using fine calibration' in log
652+
assert op.basename(fine_cal_fname) in log
649653
assert_meg_snr(raw_sss, sss_fine_cal, 82, 611)
650654
py_cal = raw_sss.info['proc_history'][0]['max_info']['sss_cal']
651655
assert (py_cal is not None)

tutorials/source-modeling/plot_forward.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
# parameter.
199199

200200
fwd = mne.make_forward_solution(raw_fname, trans=trans, src=src, bem=bem,
201-
meg=True, eeg=False, mindist=5.0, n_jobs=2,
201+
meg=True, eeg=False, mindist=5.0, n_jobs=1,
202202
verbose=True)
203203
print(fwd)
204204

tutorials/stats-source-space/plot_stats_cluster_time_frequency_repeated_measures_anova.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
times[-1], freqs[0], freqs[-1]], aspect='auto',
157157
origin='lower')
158158
# create mask for significant Time-frequency locations
159-
effect = np.ma.masked_array(effect, [sig > .05])
159+
effect[sig >= 0.05] = np.nan
160160
plt.imshow(effect.reshape(8, 211), cmap='RdBu_r', extent=[times[0],
161161
times[-1], freqs[0], freqs[-1]], aspect='auto',
162162
origin='lower')
@@ -203,8 +203,8 @@ def stat_fun(*args):
203203
# Create new stats image with only significant clusters:
204204

205205
good_clusters = np.where(cluster_p_values < .05)[0]
206-
T_obs_plot = np.ma.masked_array(T_obs,
207-
np.invert(clusters[np.squeeze(good_clusters)]))
206+
T_obs_plot = T_obs.copy()
207+
T_obs_plot[~clusters[np.squeeze(good_clusters)]] = np.nan
208208

209209
plt.figure()
210210
for f_image, cmap in zip([T_obs, T_obs_plot], [plt.cm.gray, 'RdBu_r']):
@@ -221,10 +221,13 @@ def stat_fun(*args):
221221
# Now using FDR:
222222

223223
mask, _ = fdr_correction(pvals[2])
224-
T_obs_plot2 = np.ma.masked_array(T_obs, np.invert(mask))
224+
T_obs_plot2 = T_obs.copy()
225+
T_obs_plot2[~mask.reshape(T_obs_plot.shape)] = np.nan
225226

226227
plt.figure()
227228
for f_image, cmap in zip([T_obs, T_obs_plot2], [plt.cm.gray, 'RdBu_r']):
229+
if np.isnan(f_image).all():
230+
continue # nothing to show
228231
plt.imshow(f_image, cmap=cmap, extent=[times[0], times[-1],
229232
freqs[0], freqs[-1]], aspect='auto',
230233
origin='lower')

0 commit comments

Comments
 (0)