3333)
3434from mne_bids .path import _find_matching_sidecar
3535from mne_bids .read import (
36+ _handle_channels_reading ,
3637 _handle_events_reading ,
3738 _handle_scans_reading ,
38- _handle_channels_reading ,
3939 _read_raw ,
4040 events_file_to_annotation_kwargs ,
4141 get_head_mri_trans ,
@@ -1548,7 +1548,14 @@ def _setup_nirs_channel_mismatch(tmp_path):
15481548 channels_fname = tmp_path / "channels.tsv"
15491549 _to_tsv (channels_dict , channels_fname )
15501550
1551- return raw , ch_order_snirf , ch_order_bids , channels_fname , orig_name_to_loc , orig_name_to_data
1551+ return (
1552+ raw ,
1553+ ch_order_snirf ,
1554+ ch_order_bids ,
1555+ channels_fname ,
1556+ orig_name_to_loc ,
1557+ orig_name_to_data ,
1558+ )
15521559
15531560
15541561def test_channel_mismatch_raise (tmp_path ):
@@ -1561,14 +1568,18 @@ def test_channel_mismatch_raise(tmp_path):
15611568
15621569
15631570def test_channel_mismatch_reorder (tmp_path ):
1564- raw , _ , ch_order_bids , channels_fname , orig_name_to_loc , orig_name_to_data = _setup_nirs_channel_mismatch (tmp_path )
1571+ raw , _ , ch_order_bids , channels_fname , orig_name_to_loc , orig_name_to_data = (
1572+ _setup_nirs_channel_mismatch (tmp_path )
1573+ )
15651574 with (
15661575 pytest .warns (
15671576 RuntimeWarning ,
15681577 match = r"Channel mismatch between .*channels\.tsv and the raw data file detected\. Using mismatch strategy: reorder\." ,
15691578 ),
15701579 ):
1571- raw_out = _handle_channels_reading (channels_fname , raw , ch_name_mismatch = "reorder" )
1580+ raw_out = _handle_channels_reading (
1581+ channels_fname , raw , ch_name_mismatch = "reorder"
1582+ )
15721583 assert raw_out .ch_names == ch_order_bids
15731584 for i , new_name in enumerate (raw_out .ch_names ):
15741585 np .testing .assert_allclose (
@@ -1580,14 +1591,23 @@ def test_channel_mismatch_reorder(tmp_path):
15801591
15811592
15821593def test_channel_mismatch_rename (tmp_path ):
1583- raw , ch_order_snirf , ch_order_bids , channels_fname , orig_name_to_loc , orig_name_to_data = _setup_nirs_channel_mismatch (tmp_path )
1594+ (
1595+ raw ,
1596+ ch_order_snirf ,
1597+ ch_order_bids ,
1598+ channels_fname ,
1599+ orig_name_to_loc ,
1600+ orig_name_to_data ,
1601+ ) = _setup_nirs_channel_mismatch (tmp_path )
15841602 with (
15851603 pytest .warns (
15861604 RuntimeWarning ,
15871605 match = r"Channel mismatch between .*channels\.tsv and the raw data file detected\. Using mismatch strategy: rename\." ,
15881606 ),
15891607 ):
1590- raw_out_rename = _handle_channels_reading (channels_fname , raw .copy (), ch_name_mismatch = "rename" )
1608+ raw_out_rename = _handle_channels_reading (
1609+ channels_fname , raw .copy (), ch_name_mismatch = "rename"
1610+ )
15911611 assert raw_out_rename .ch_names == ch_order_bids
15921612 for i in range (len (ch_order_bids )):
15931613 orig_name_at_i = ch_order_snirf [i ]
0 commit comments