def test_missing_data(): "Missing data should be filled with nans" el = pyarbus.read_eyelink(short_test_file) time = el.eye_used.time diffs = np.unique(np.diff(time)) assert diffs == nitime.TimeArray([1], time_unit='ms') assert nitime.TimeArray(len(time)-1, time_unit='ms') == (time[-1]-time[0])
def test_read_custom_eyelink(): "Read a short eyelink file with a customized Eyelink class" class CustomizedEyelink(pyarbus.Eyelink): """ A sample custom Eyelink class. Additional attributes defined by this class: e.experiment : string """ @property def experiment(self): """ The name of the python file that ran at the beginning of this recording. Just grabs it from the `e.msg[0]`, which is something like: 'MSG\t13898560 Experiment: test_movieqt.py' ...and makes e.experiment be just `test_movieqt` """ return self.msgs[0].split(b' ')[-1].split(b'.')[0].decode('ascii') customized = pyarbus.read_eyelink(short_test_file, Eyelink=CustomizedEyelink) npt.assert_(hasattr(customized, 'experiment')) npt.assert_equal(customized.experiment, 'test_movieqt')
def test_missing_data(): "Missing data should be filled with nans" el = pyarbus.read_eyelink(short_test_file) time = el.eye_used.time diffs = np.unique(np.diff(time)) assert diffs == nitime.TimeArray([1], time_unit='ms') assert nitime.TimeArray(len(time) - 1, time_unit='ms') == (time[-1] - time[0])
def test_read_eyelink_large(): "Read a gunzipped .asc file (~10MB)" el = pyarbus.read_eyelink(gz_test_file) # cache this for viz tests which use this file, to save time pyarbus.data._cache[gz_test_file] = el return el
def test_read_eyelink(): "Read a short eyelink file with discontinuous time points" return pyarbus.read_eyelink(short_test_file)