@@ -465,14 +465,21 @@ def test_1020_selection():
465465@testing .requires_testing_data
466466def test_find_ch_adjacency ():
467467 """Test computing the adjacency matrix."""
468- raw = read_raw_fif (raw_fname , preload = True )
468+ raw = read_raw_fif (raw_fname )
469469 sizes = {"mag" : 828 , "grad" : 1700 , "eeg" : 384 }
470470 nchans = {"mag" : 102 , "grad" : 204 , "eeg" : 60 }
471471 for ch_type in ["mag" , "grad" , "eeg" ]:
472472 conn , ch_names = find_ch_adjacency (raw .info , ch_type )
473473 # Silly test for checking the number of neighbors.
474474 assert_equal (conn .getnnz (), sizes [ch_type ])
475475 assert_equal (len (ch_names ), nchans [ch_type ])
476+ kwargs = dict (exclude = ())
477+ if ch_type in ("mag" , "grad" ):
478+ kwargs ["meg" ] = ch_type
479+ else :
480+ kwargs [ch_type ] = True
481+ want_names = [raw .ch_names [pick ] for pick in pick_types (raw .info , ** kwargs )]
482+ assert ch_names == want_names
476483 pytest .raises (ValueError , find_ch_adjacency , raw .info , None )
477484
478485 # Test computing the conn matrix with gradiometers.
@@ -506,7 +513,7 @@ def test_find_ch_adjacency():
506513def test_neuromag122_adjacency ():
507514 """Test computing the adjacency matrix of Neuromag122-Data."""
508515 nm122_fname = testing_path / "misc" / "neuromag122_test_file-raw.fif"
509- raw = read_raw_fif (nm122_fname , preload = True )
516+ raw = read_raw_fif (nm122_fname )
510517 conn , ch_names = find_ch_adjacency (raw .info , "grad" )
511518 assert conn .getnnz () == 1564
512519 assert len (ch_names ) == 122
@@ -515,7 +522,7 @@ def test_neuromag122_adjacency():
515522
516523def test_drop_channels ():
517524 """Test if dropping channels works with various arguments."""
518- raw = read_raw_fif (raw_fname , preload = True ).crop (0 , 0.1 )
525+ raw = read_raw_fif (raw_fname ).crop (0 , 0.1 )
519526 raw .drop_channels (["MEG 0111" ]) # list argument
520527 raw .drop_channels ("MEG 0112" ) # str argument
521528 raw .drop_channels ({"MEG 0132" , "MEG 0133" }) # set argument
@@ -535,7 +542,7 @@ def test_drop_channels():
535542
536543def test_pick_channels ():
537544 """Test if picking channels works with various arguments."""
538- raw = read_raw_fif (raw_fname , preload = True ).crop (0 , 0.1 )
545+ raw = read_raw_fif (raw_fname ).crop (0 , 0.1 )
539546
540547 # selected correctly 3 channels
541548 raw .pick (["MEG 0113" , "MEG 0112" , "MEG 0111" ])
0 commit comments