def test_get_protocol(subject): if subject.startswith("DNE"): with pytest.raises(exc.UnknownProtocolError): get_protocol(subject) else: protocol = get_protocol(subject) if subject.startswith("R1"): assert protocol == "r1" elif subject.startswith("LTP"): assert protocol == "ltp" else: assert protocol == "pyfr"
def to_absolute(row): if row["eegfile"].startswith("/"): return row["eegfile"] subject = row["subject"] return "/" + constants.rhino_paths["processed_eeg"][0].format( protocol=get_protocol(subject), subject=subject, experiment=row["experiment"], session=row["session"], basename=row["eegfile"])
def to_absolute(row): if row["eegfile"].startswith("/"): return row["eegfile"] subject = self.subject if self.subject is not None else row["subject"] experiment = self.experiment if self.experiment is not None else row["experiment"] session = self.session if self.session is not None else row["session"] return "/" + constants.rhino_paths["processed_eeg"][0].format( protocol=get_protocol(subject), subject=subject, experiment=experiment, session=session, basename=row["eegfile"] )