Пример #1
0
    def test_load_json(self, kind, subject, localization, montage):
        if montage == 0:
            path = datafile("{}_{}.json".format(subject, kind))
        else:
            path = datafile("{}_{}_{}.json".format(subject, montage, kind))

        reader = MontageReader(kind,
                               subject=subject,
                               localization=localization,
                               montage=montage,
                               file_path=path)
        df = reader.load()

        if kind == 'contacts':
            assert 'contact' in df.columns
        else:
            assert 'contact_1' in df.columns
            assert 'contact_2' in df.columns
Пример #2
0
    def test_load_matlab(self, kind, subject, montage):
        reader = MontageReader(kind, subject=subject, localization=0,
                               montage=montage)
        path = datafile("{}_{}.mat".format(subject, "pairs" if "pairs" in kind else "contacts"))

        df = reader.fromfile(path)

        if "contacts" in kind:
            assert "contact" in df.columns
        else:
            assert "contact_1" in df.columns
            assert "contact_2" in df.columns
Пример #3
0
 def test_load(self):
     path = datafile('localization.json')
     reader = LocalizationReader('localization', subject='R1405E', file_path=path)
     df = reader.load()
     assert isinstance(df, pd.DataFrame)