File tree Expand file tree Collapse file tree
src/aind_dynamic_foraging_basic_analysis/metrics Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -278,13 +278,17 @@ def get_average_signal_window(
278278 if not alignment_event .endswith ('in_session' ):
279279 raise ValueError (f"alignment_event '{ alignment_event } ' must end with 'in_session'." )
280280
281+ if not hasattr (nwb , "df_trials" ):
282+ raise ValueError ("You need to compute df_trials: nwb_utils.create_trials_df(nwb)" )
283+
281284 # Check alignment_event is in df_trials columns
282285 if alignment_event not in nwb .df_trials .columns :
283286 raise ValueError (f"alignment_event '{ alignment_event } ' not found in df_trials columns." )
284287
285288 # Get output column name
286289 if output_col is None :
287- output_col = f"{ data_col } _{ channel } _{ offsets [0 ]} _{ offsets [1 ]} _{ alignment_event .replace ('_in_session' ,'' )} "
290+ output_col = f"{ data_col } _{ channel } _{ offsets [0 ]} _\
291+ { offsets [1 ]} _{ alignment_event .replace ('_in_session' ,'' )} "
288292
289293 df_trials = nwb .df_trials .copy ()
290294
You can’t perform that action at this time.
0 commit comments