From 886d741a088b36dcb8d1bdfb00e1a4d97f60cd81 Mon Sep 17 00:00:00 2001 From: Florian Rau Date: Wed, 4 Oct 2023 16:48:18 +0200 Subject: [PATCH] Update commands.py --- iblrig/commands.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/iblrig/commands.py b/iblrig/commands.py index 8bc39f857..ef44e44f1 100644 --- a/iblrig/commands.py +++ b/iblrig/commands.py @@ -8,7 +8,7 @@ from iblutil.util import setup_logger from ibllib.io import raw_data_loaders -from iblrig.transfer_experiments import BehaviorCopier, VideoCopier +from iblrig.transfer_experiments import BehaviorCopier, VideoCopier, EphysCopier import iblrig from iblrig.hardware import Bpod from iblrig.path_helper import load_settings_yaml, get_local_and_remote_paths @@ -111,8 +111,14 @@ def transfer_ephys_data(local_path: Path = None, remote_path: Path = None, dry: logger.info(f'Local Path: {local_path}') logger.info(f'Remote Path: {remote_path}') - # TODO - pass + for flag in list(local_path.rglob('transfer_me.flag')): + session_path = flag.parent + vc = EphysCopier(session_path, remote_subjects_folder=remote_path) + logger.critical(f"{vc.state}, {vc.session_path}") + if not dry: + vc.run() + remove_local_sessions(weeks=2, local_path=local_path, + remote_path=remote_path, dry=dry, tag='ephys') def transfer_video_data(local_path: Path = None, remote_path: Path = None, dry: bool = False): @@ -125,10 +131,7 @@ def transfer_video_data(local_path: Path = None, remote_path: Path = None, dry: logger.info(f'Local Path: {local_path}') logger.info(f'Remote Path: {remote_path}') - flags = list(local_path.rglob('transfer_me.flag')) - logger.info(f'Found {len(flags)} sessions that require transferring.') - - for flag in flags: + for flag in list(local_path.rglob('transfer_me.flag')): session_path = flag.parent vc = VideoCopier(session_path, remote_subjects_folder=remote_path) logger.critical(f"{vc.state}, {vc.session_path}")