Skip to content

Commit

Permalink
Merge pull request #645 from int-brain-lab/restrict_cameras
Browse files Browse the repository at this point in the history
PR to incorporate ONE changes
  • Loading branch information
mayofaulkner authored Sep 6, 2023
2 parents e72578f + 682cc66 commit 49dd57b
Show file tree
Hide file tree
Showing 6 changed files with 288 additions and 168 deletions.
2 changes: 1 addition & 1 deletion ibllib/oneibl/data_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def uploadData(self, outputs, version, **kwargs):

for collection, files in collections.items():
globus_files = self.globus.ls(f'flatiron_{self.lab}', collection, remove_uuid=True, return_size=True)
file_names = [gl[0] for gl in globus_files]
file_names = [str(gl[0]) for gl in globus_files]
file_sizes = [gl[1] for gl in globus_files]

for name, details in files.items():
Expand Down
2 changes: 1 addition & 1 deletion ibllib/oneibl/patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ def _scp(self, local_path, remote_path, dry=True):
_logger.info(f"Copy {local_path} to {remote_path}")
if not dry:
if not Path(remote_path).parent.exists():
Path(remote_path).parent.mkdir(exist_ok=True)
Path(remote_path).parent.mkdir(exist_ok=True, parents=True)
shutil.copy(local_path, remote_path)
return 0, ''

Expand Down
8 changes: 7 additions & 1 deletion ibllib/pipes/dynamic_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,10 @@ def make_pipeline(session_path, **pkwargs):

# Video tasks
if 'cameras' in devices:
cams = list(devices['cameras'].keys())
subset_cams = [c for c in cams if c in ('left', 'right', 'body')]
video_kwargs = {'device_collection': 'raw_video_data',
'cameras': list(devices['cameras'].keys())}
'cameras': cams}
video_compressed = sess_params.get_video_compressed(acquisition_description)

if video_compressed:
Expand All @@ -326,10 +328,14 @@ def make_pipeline(session_path, **pkwargs):
tasks[tn] = type((tn := f'VideoSyncQC_{sync}'), (vtasks.VideoSyncQcBpod,), {})(
**kwargs, **video_kwargs, **sync_kwargs, parents=[tasks['VideoCompress']])
elif sync == 'nidq':
# Here we restrict to videos that we support (left, right or body)
video_kwargs['cameras'] = subset_cams
tasks[tn] = type((tn := f'VideoSyncQC_{sync}'), (vtasks.VideoSyncQcNidq,), {})(
**kwargs, **video_kwargs, **sync_kwargs, parents=[tasks['VideoCompress']] + sync_tasks)

if sync_kwargs['sync'] != 'bpod':
# Here we restrict to videos that we support (left, right or body)
video_kwargs['cameras'] = subset_cams
tasks[tn] = type((tn := 'DLC'), (vtasks.DLC,), {})(
**kwargs, **video_kwargs, parents=[dlc_parent_task])
tasks['PostDLC'] = type('PostDLC', (epp.EphysPostDLC,), {})(
Expand Down
1 change: 1 addition & 0 deletions ibllib/pipes/video_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ def _run(self, **kwargs):

mp4_files = self.session_path.joinpath(self.device_collection).glob('*.mp4')
labels = [label_from_path(x) for x in mp4_files]
labels = [lab for lab in labels if lab in ('left', 'right', 'body')]

kwargs = {}
if self.sync_namespace == 'timeline':
Expand Down
Loading

0 comments on commit 49dd57b

Please sign in to comment.