Skip to content

Commit

Permalink
add test for scores
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrockhill committed Apr 16, 2022
1 parent a0e16dc commit 6e02337
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mne/preprocessing/tests/test_ica.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ def test_ica_noop(n_components, n_pca_components, tmp_path):

@requires_sklearn
@pytest.mark.parametrize("method, max_iter_default", [("fastica", 1000),
("infomax", 500), ("picard", 500)])
("infomax", 500),
("picard", 500)])
def test_ica_max_iter_(method, max_iter_default):
"""Test that ICA.max_iter is set to the right defaults."""
_skip_check_picard(method)
Expand Down Expand Up @@ -1321,9 +1322,10 @@ def test_ica_labels():
for key in ('ecg', 'eog', 'ref_meg', 'ecg/ECG-MAG'):
assert key in ica.labels_

ica.find_bads_muscle(raw)
scores = ica.find_bads_muscle(raw)[1]
assert 'muscle' in ica.labels_
assert ica.labels_['muscle'] == [0, 1, 2, 3]
assert_allclose(scores, [0.2, 0.25, 0.35, 0.55], atol=0.03)


@requires_sklearn
Expand Down

0 comments on commit 6e02337

Please sign in to comment.