Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added overlap_pct_th argument to non_overlap_df #106

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions soundbay/utils/metadata_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _split_calls_with_low_overlap(
return merged


def non_overlap_df(input_df: pd.DataFrame) -> pd.DataFrame:
def non_overlap_df(input_df: pd.DataFrame, overlap_pct_th: float = 0) -> pd.DataFrame:
"""
Args:
input_df: DataFrame with possibly overlapping calls
Expand All @@ -177,7 +177,7 @@ def non_overlap_df(input_df: pd.DataFrame) -> pd.DataFrame:
non_overlap = []
for file_name, file_df in input_df.groupby(by='filename'):
file_df.sort_values(by='begin_time', inplace=True)
merged = merge_calls(file_df)
merged = merge_calls(file_df, overlap_pct_th)
non_overlap.extend(merged)
non_overlap = pd.DataFrame(non_overlap)
non_overlap['call_length'] = non_overlap['end_time'] - non_overlap['begin_time']
Expand Down