def loaded_lab_file(multifreq_lab_file): chtrig = 1 header_lab, channels_lab = txt.read_header_and_channels(multifreq_lab_file) # just a few quick checks to make sure the data loaded correctly assert len(channels_lab[0]) == 5 assert 'Interval=' in header_lab[0] return header_lab, channels_lab, chtrig
def loaded_lab_file(multifreq_lab_file): chtrig = 1 header_lab, channels_lab = txt.read_header_and_channels( multifreq_lab_file, chtrig) # just a few quick checks to make sure the data loaded correctly assert len( channels_lab[152109 - 9]) == 6 # check the comment has been eliminated assert 'Interval=' in header_lab[0] return header_lab, channels_lab, chtrig
def loaded_acq_file(samefreq_short_txt_file): chtrig = 2 header_acq, channels_acq = txt.read_header_and_channels(samefreq_short_txt_file) # just a few quick checks to make sure the data loaded correctly assert len(header_acq) == 8 # check proper header lenght assert len(channels_acq) == 1048560 # check proper number of timepoints assert len(header_acq[-1]) == 2 # check extra line is deleted assert 'acq' in header_acq[0][0] return header_acq, channels_acq, chtrig
def test_noheader_acq_error(samefreq_noheader_txt_file): chtrig = 2 with raises(AttributeError) as errorinfo: txt.populate_phys_input(samefreq_noheader_txt_file, chtrig=chtrig) assert 'not supported' in str(errorinfo.value) # test file without header for process_acq header, channels = txt.read_header_and_channels(samefreq_noheader_txt_file) with raises(AttributeError) as errorinfo: txt.process_acq(channels, chtrig=chtrig) assert 'not supported' in str(errorinfo.value)
def test_process_labchart_notime(notime_lab_file): chtrig = 0 header, channels = txt.read_header_and_channels(notime_lab_file, chtrig) phys_obj = txt.process_labchart(channels, chtrig=chtrig, header=header) assert len(phys_obj.timeseries) == len(channels[0]) + 1