Skip to content

Commit

Permalink
Fix music.Melody.generate_random_melody doctest, forcing pitch_names …
Browse files Browse the repository at this point in the history
…as list[str]
  • Loading branch information
YannickJadoul committed Nov 29, 2024
1 parent b5c5ad0 commit 93d6817
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thebeat/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ class Melody(thebeat.core.sequence.BaseSequence):
def __init__(
self,
rhythm: thebeat.music.Rhythm,
pitch_names: npt.NDArray[str] | list[str] | str,
pitch_names: npt.NDArray[np.str_] | list[str] | str,
octave: int | None = None,
key: str | None = None,
is_played: list | None = None,
Expand Down Expand Up @@ -874,7 +874,7 @@ def __init__(
else:
pitch_names_list = pitch_names

self.pitch_names = pitch_names_list
self.pitch_names = [str(pitch_name) for pitch_name in pitch_names_list]

# Add initial events
self.events = self._make_namedtuples(
Expand Down

0 comments on commit 93d6817

Please sign in to comment.