File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
iblrig_custom_tasks/_sp_passiveVideo Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 44TODO Add custom task list to Session class
55"""
66import time
7+ import shutil
78from pathlib import Path
89from collections import defaultdict
910from functools import partial
@@ -157,6 +158,7 @@ class Session(BpodMixin):
157158 """Play a single video."""
158159
159160 protocol_name = '_sp_passiveVideo'
161+ extractor_tasks = ['PassiveVideoTimeline' ]
160162
161163 def __init__ (self , ** kwargs ):
162164 super ().__init__ (** kwargs )
@@ -179,6 +181,14 @@ def save(self):
179181 if 20 > self ._log_level > 0 :
180182 stats = self .video .stats
181183 stats .to_parquet (self .paths .STATS_FILE_PATH )
184+ if self .video ._media and self .video ._media .get_mrl ().endswith (str (self .task_params .VIDEO )):
185+ ext = Path (self .task_params .VIDEO ).suffix
186+ video_file_path = self .paths .DATA_FILE_PATH .with_name (f'_sp_video.raw{ ext } ' )
187+ _logger .info ('Copying %s -> %s' , self .task_params .VIDEO , video_file_path )
188+ shutil .copy (self .task_params .VIDEO , video_file_path )
189+ else :
190+ _logger .warning ('Video not copied (video most likely was not played)' )
191+ self . self .video ._media .get_mrl ()
182192 self .paths .SESSION_FOLDER .joinpath ('transfer_me.flag' ).touch ()
183193
184194 def start_hardware (self ):
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44
55[project ]
66name = " project_extraction"
7- version = " 0.5.2 "
7+ version = " 0.5.3 "
88description = " Custom extractors for satellite tasks"
99dynamic = [ " readme" ]
1010keywords = [ " IBL" , " neuro-science" ]
You can’t perform that action at this time.
0 commit comments