Skip to content

Commit

Permalink
Minor Fix
Browse files Browse the repository at this point in the history
Minor fix in restart_checking to handle empty motion dataframe
  • Loading branch information
humbleOldSage committed Jan 26, 2024
1 parent 4981311 commit c392f87
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions emission/analysis/intake/segmentation/restart_checking.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def is_tracking_restarted_in_range(start_ts, end_ts,transition_df):

def get_ongoing_motion_in_range(start_ts, end_ts, motion_df):

## in case when we receive an empty dataframe, there's nothing to
## process
if motion_df.shape == (0,0):
return motion_df
motion_df_start_idx=motion_df.ts.searchsorted(start_ts,side='left')
motion_df_end_idx=motion_df.ts.searchsorted(end_ts,side='right')
filtered_motion_df=motion_df.iloc[motion_df_start_idx:motion_df_end_idx]
Expand Down

0 comments on commit c392f87

Please sign in to comment.