Skip to content

Commit

Permalink
Update miditoolkit/midi/containers.py
Browse files Browse the repository at this point in the history
Co-authored-by: Aarni Koskela <[email protected]>
  • Loading branch information
Natooz and akx authored Nov 22, 2023
1 parent a4270b7 commit db77157
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion miditoolkit/midi/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,11 @@ def __init__(
self.control_changes = [] if control_changes is None else control_changes
self.pedals = [] if pedals is None else pedals

def remove_notes_with_no_duration(self):
def remove_invalid_notes(self, verbose: bool = True) -> None:
warnings.warn("Call remove_notes_with_no_duration() instead.", DeprecationWarning)

Check failure on line 288 in miditoolkit/midi/containers.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (F821)

miditoolkit/midi/containers.py:288:9: F821 Undefined name `warnings`
return self.remove_notes_with_no_duration()

def remove_notes_with_no_duration(self) -> None:
"""Removes (inplace) notes whose end time is before or at their start time."""
for i in range(self.nb_notes - 1, -1, -1):
if self.notes[i].start >= self.notes[i].end:
Expand Down

0 comments on commit db77157

Please sign in to comment.