From b63e15af91d23f3f28262796a81cdb025a911a59 Mon Sep 17 00:00:00 2001 From: Loann Peurey Date: Tue, 9 Jul 2024 16:43:02 +0200 Subject: [PATCH] dont fail importation when input dataframe has duplicate columns with recordings datafarme e.g. --- ChildProject/annotations.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ChildProject/annotations.py b/ChildProject/annotations.py index 3d38a58f..23a0f724 100644 --- a/ChildProject/annotations.py +++ b/ChildProject/annotations.py @@ -632,10 +632,11 @@ def import_annotations( assert (input_processed["range_onset"] >= 0).all(), "range_onset must be greater or equal to 0" if "duration" in self.project.recordings.columns: assert (input_processed["range_offset"] <= input_processed.merge(self.project.recordings, - how='left', - on='recording_filename', - validate='m:1' - ).reset_index()["duration"] + how='left', + on='recording_filename', + validate='m:1', + suffixes=('_input', ''), + ).reset_index()["duration"] ).all(), "range_offset must be smaller than the duration of the recording" missing_recordings = input_processed[