Skip to content

Commit f5d31c4

Browse files
returning original nwb.df_trials if channel not there.
1 parent 4ab80d3 commit f5d31c4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/aind_dynamic_foraging_basic_analysis/metrics/trial_metrics.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from aind_dynamic_foraging_data_utils import alignment as an
1111
import numpy as np
1212
import pandas as pd
13+
import warnings
1314

1415
import aind_dynamic_foraging_basic_analysis.licks.annotation as a
1516

@@ -346,7 +347,8 @@ def get_average_signal_window(
346347
raise ValueError(f"alignment_event '{alignment_event}' not found in df_trials columns.")
347348

348349
if channel not in nwb.df_fip.event.unique():
349-
raise ValueError(f"{channel} channel not found in df_fip.")
350+
warnings.warn(f"{channel} channel not found in df_fip. Returning original df_trials.")
351+
return nwb.df_trials
350352

351353
if data_column not in nwb.df_fip.columns:
352354
raise ValueError(f"data column '{data_column}' not found in df_trials columns.")

0 commit comments

Comments
 (0)