Skip to content

Commit 44ca4c2

Browse files
committed
Remove some assert-raises tests
1 parent 236d036 commit 44ca4c2

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

mne/inverse_sparse/tests/test_gamma_map.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,6 @@ def test_gamma_map_vol_sphere():
130130
eeg=False, meg=True)
131131

132132
alpha = 0.5
133-
pytest.raises(ValueError, gamma_map, evoked, fwd, cov, alpha,
134-
loose=0, return_residual=False)
135-
136-
pytest.raises(ValueError, gamma_map, evoked, fwd, cov, alpha,
137-
loose=0.2, return_residual=False)
138-
139133
stc = gamma_map(evoked, fwd, cov, alpha, tol=1e-4,
140134
xyz_same_gamma=False, update_mode=2,
141135
return_residual=False)

mne/inverse_sparse/tests/test_mxne_inverse.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,8 @@ def test_mxne_vol_sphere():
204204
fwd = mne.make_forward_solution(info, trans=None, src=src,
205205
bem=sphere, eeg=False, meg=True)
206206

207-
alpha = 80.
208-
pytest.raises(ValueError, mixed_norm, evoked, fwd, cov, alpha,
209-
loose=0.0, return_residual=False,
210-
maxit=3, tol=1e-8, active_set_size=10)
211-
212-
pytest.raises(ValueError, mixed_norm, evoked, fwd, cov, alpha,
213-
loose=0.2, return_residual=False,
214-
maxit=3, tol=1e-8, active_set_size=10)
215-
216207
# irMxNE tests
208+
alpha = 80.
217209
with catch_logging() as log:
218210
stc = mixed_norm(evoked_l21, fwd, cov, alpha,
219211
n_mxne_iter=1, maxit=30, tol=1e-8,

mne/minimum_norm/inverse.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,10 @@ def _prepare_forward(forward, info, noise_cov, fixed, loose, rank, pca,
14071407
raise ValueError('Computing inverse solutions for volume source '
14081408
'spaces with fixed orientations is not '
14091409
'supported.')
1410+
if 'volume' in loose and any(v < 1 for v in loose.values()):
1411+
raise ValueError('Computing inverse solutions with restricted '
1412+
'orientations (loose < 1) is not supported for '
1413+
'volume source spaces.')
14101414

14111415
# Deal with "depth"
14121416
if exp is not None:
@@ -1437,7 +1441,7 @@ def _prepare_forward(forward, info, noise_cov, fixed, loose, rank, pca,
14371441
'Forward operator has fixed orientation and can only '
14381442
'be used to make a fixed-orientation inverse '
14391443
'operator.')
1440-
if loose.get('surface', 1.) < 1. and not forward['surf_ori']:
1444+
if any(v < 1 for v in loose.values()) and not forward['surf_ori']:
14411445
logger.info('Converting forward solution to surface orientation')
14421446
convert_forward_solution(
14431447
forward, surf_ori=True, use_cps=use_cps, copy=False)

0 commit comments

Comments
 (0)