Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mscuthbert committed Jul 28, 2024
1 parent 93f3ad3 commit 87702e1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions music21/braille/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 189,7 @@ def chordToBraille(music21Chord, descending=True, showOctave=True):
music21Chord.editorial.brailleEnglish.append(f'{music21Chord} None')
return symbols['basic_exception']
chordTrans.append(brailleNote)
englishJoined = '\n'.join(initNote.editorial.brailleEnglish)
englishJoined = '\n'.join(initNote.editorial.get('brailleEnglish', []))
music21Chord.editorial.brailleEnglish.append(
f'{direction} Chord:\n{englishJoined}'
)
Expand Down Expand Up @@ -531,7 531,7 @@ def metronomeMarkToBraille(music21MetronomeMark):
metroNote = note.Note('C4', quarterLength=music21MetronomeMark.referent.quarterLength)
brailleNote = noteToBraille(metroNote, showOctave=False)
metroTrans.append(brailleNote)
englishJoined = ' '.join(metroNote.editorial.brailleEnglish)
englishJoined = ' '.join(metroNote.editorial.get(brailleEnglish, []))
music21MetronomeMark.editorial.brailleEnglish.append(
f'Metronome Note {englishJoined}'
)
Expand Down
8 changes: 4 additions & 4 deletions music21/derivation.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 240,10 @@ def chain(self) -> Generator[base.Music21Object, None, None]:
>>> list(s3.derivation.chain()) == [s2, s1]
True
'''
origin = self.origin
while origin is not None:
yield origin
origin = origin.derivation.origin
orig: Music21Object | None = self.origin
while orig is not None:
yield orig
orig = orig.derivation.origin

@property
def method(self) -> str|None:
Expand Down
9 changes: 6 additions & 3 deletions music21/stream/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7982,9 7982,12 @@ def flatten(self: StreamType, retainContainers=False) -> StreamType:
newId = str(sOldId) '_' method
sNew.id = newId

sNew._derivation = derivation.Derivation(sNew)
sNew._derivation.origin = self
sNew.derivation.method = method
sNew_derivation = derivation.Derivation(sNew)
sNew_derivation.origin = self
sNew_derivation.method = method

sNew.derivation = sNew_derivation

# storing .elements in here necessitates
# create a new, independent cache instance in the flat representation
sNew._cache = {}
Expand Down

0 comments on commit 87702e1

Please sign in to comment.