Skip to content

Commit 6808b01

Browse files
committed
Fix for EphysQC to look in local folders
1 parent 977c58b commit 6808b01

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ibllib/ephys/ephysqc.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ class EphysQC(base.QC):
4242
default database if not given.
4343
"""
4444

45-
def __init__(self, probe_id, **kwargs):
45+
def __init__(self, probe_id, session_path=None, **kwargs):
4646
super().__init__(probe_id, endpoint='insertions', **kwargs)
4747
self.pid = probe_id
48+
self.session_path = session_path
4849
self.stream = kwargs.pop('stream', True)
4950
keys = ('ap', 'ap_meta', 'lf', 'lf_meta')
5051
self.data = Bunch.fromkeys(keys)
@@ -57,7 +58,9 @@ def _ensure_required_data(self):
5758
"""
5859
assert self.one is not None, 'ONE instance is required to ensure required data'
5960
eid, pname = self.one.pid2eid(self.pid)
60-
self.probe_path = self.one.eid2path(eid).joinpath('raw_ephys_data', pname)
61+
if self.session_path is None:
62+
self.session_path = self.one.eid2path(eid)
63+
self.probe_path = Path(self.session_path).joinpath('raw_ephys_data', pname)
6164
# Check if there is at least one meta file available
6265
meta_files = list(self.probe_path.rglob('*.meta'))
6366
assert len(meta_files) != 0, f'No meta files in {self.probe_path}'

ibllib/pipes/ephys_preprocessing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _run(self, overwrite=False):
6969
pids = [p['id'] for p in create_alyx_probe_insertions(self.session_path, one=self.one)]
7070
qc_files = []
7171
for pid in pids:
72-
eqc = ephysqc.EphysQC(pid, one=self.one)
72+
eqc = ephysqc.EphysQC(pid, session_path=self.session_path, one=self.one)
7373
qc_files.extend(eqc.run(update=True, overwrite=overwrite))
7474
return qc_files
7575

0 commit comments

Comments
 (0)