1717
1818
1919class ContrastLR (BaseBpodTrialsExtractor ):
20- """
21- Get left and right contrasts from raw datafile.
22- """
20+ """Get left and right contrasts from raw datafile."""
2321 save_names = ('_ibl_trials.contrastLeft.npy' , '_ibl_trials.contrastRight.npy' )
2422 var_names = ('contrastLeft' , 'contrastRight' )
2523
@@ -32,9 +30,7 @@ def _extract(self, **kwargs):
3230
3331
3432class ProbaContrasts (BaseBpodTrialsExtractor ):
35- """
36- Bpod pre-generated values for probabilityLeft, contrastLR, phase, quiescence
37- """
33+ """Bpod pre-generated values for probabilityLeft, contrastLR, phase, quiescence."""
3834 save_names = ('_ibl_trials.contrastLeft.npy' , '_ibl_trials.contrastRight.npy' , None , None ,
3935 '_ibl_trials.probabilityLeft.npy' , '_ibl_trials.quiescencePeriod.npy' )
4036 var_names = ('contrastLeft' , 'contrastRight' , 'phase' ,
@@ -103,10 +99,12 @@ class TrialsTableBiased(BaseBpodTrialsExtractor):
10399 'wheelMoves_peakAmplitude' , 'peakVelocity_times' , 'is_final_movement' )
104100
105101 def _extract (self , extractor_classes = None , ** kwargs ):
102+ extractor_classes = extractor_classes or []
106103 base = [Intervals , GoCueTimes , ResponseTimes , Choice , StimOnOffFreezeTimes , ContrastLR , FeedbackTimes , FeedbackType ,
107104 RewardVolume , ProbabilityLeft , Wheel ]
108- out , _ = run_extractor_classes (base , session_path = self .session_path , bpod_trials = self .bpod_trials , settings = self .settings ,
109- save = False , task_collection = self .task_collection )
105+ out , _ = run_extractor_classes (
106+ base + extractor_classes , session_path = self .session_path , bpod_trials = self .bpod_trials ,
107+ settings = self .settings , save = False , task_collection = self .task_collection )
110108
111109 table = AlfBunch ({k : out .pop (k ) for k in list (out .keys ()) if k not in self .var_names })
112110 assert len (table .keys ()) == 12
@@ -130,11 +128,13 @@ class TrialsTableEphys(BaseBpodTrialsExtractor):
130128 'phase' , 'position' , 'quiescence' )
131129
132130 def _extract (self , extractor_classes = None , ** kwargs ):
131+ extractor_classes = extractor_classes or []
133132 base = [Intervals , GoCueTimes , ResponseTimes , Choice , StimOnOffFreezeTimes , ProbaContrasts ,
134133 FeedbackTimes , FeedbackType , RewardVolume , Wheel ]
135134 # Exclude from trials table
136- out , _ = run_extractor_classes (base , session_path = self .session_path , bpod_trials = self .bpod_trials , settings = self .settings ,
137- save = False , task_collection = self .task_collection )
135+ out , _ = run_extractor_classes (
136+ base + extractor_classes , session_path = self .session_path , bpod_trials = self .bpod_trials ,
137+ settings = self .settings , save = False , task_collection = self .task_collection )
138138 table = AlfBunch ({k : v for k , v in out .items () if k not in self .var_names })
139139 assert len (table .keys ()) == 12
140140
@@ -158,11 +158,13 @@ class BiasedTrials(BaseBpodTrialsExtractor):
158158 'phase' , 'position' , 'quiescence' )
159159
160160 def _extract (self , extractor_classes = None , ** kwargs ) -> dict :
161+ extractor_classes = extractor_classes or []
161162 base = [GoCueTriggerTimes , StimOnTriggerTimes , ItiInTimes , StimOffTriggerTimes , StimFreezeTriggerTimes ,
162163 ErrorCueTriggerTimes , TrialsTableBiased , IncludedTrials , PhasePosQuiescence ]
163164 # Exclude from trials table
164- out , _ = run_extractor_classes (base , session_path = self .session_path , bpod_trials = self .bpod_trials , settings = self .settings ,
165- save = False , task_collection = self .task_collection )
165+ out , _ = run_extractor_classes (
166+ base + extractor_classes , session_path = self .session_path , bpod_trials = self .bpod_trials ,
167+ settings = self .settings , save = False , task_collection = self .task_collection )
166168 return {k : out [k ] for k in self .var_names }
167169
168170
@@ -181,13 +183,15 @@ class EphysTrials(BaseBpodTrialsExtractor):
181183 'phase' , 'position' , 'quiescence' )
182184
183185 def _extract (self , extractor_classes = None , ** kwargs ) -> dict :
186+ extractor_classes = extractor_classes or []
184187 base = [GoCueTriggerTimes , StimOnTriggerTimes , ItiInTimes , StimOffTriggerTimes , StimFreezeTriggerTimes ,
185188 ErrorCueTriggerTimes , TrialsTableEphys , IncludedTrials , PhasePosQuiescence ]
186189 # Get all detected TTLs. These are stored for QC purposes
187190 self .frame2ttl , self .audio = raw .load_bpod_fronts (self .session_path , data = self .bpod_trials )
188191 # Exclude from trials table
189- out , _ = run_extractor_classes (base , session_path = self .session_path , bpod_trials = self .bpod_trials , settings = self .settings ,
190- save = False , task_collection = self .task_collection )
192+ out , _ = run_extractor_classes (
193+ base + extractor_classes , session_path = self .session_path , bpod_trials = self .bpod_trials ,
194+ settings = self .settings , save = False , task_collection = self .task_collection )
191195 return {k : out [k ] for k in self .var_names }
192196
193197
0 commit comments