Skip to content

Commit

Permalink
dont fail importation when input dataframe has duplicate columns with…
Browse files Browse the repository at this point in the history
… recordings datafarme e.g. <duration>
  • Loading branch information
LoannPeurey committed Jul 9, 2024
1 parent bf67b05 commit b63e15a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ChildProject/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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[
Expand Down

0 comments on commit b63e15a

Please sign in to comment.