From 955224c4ffa0213f104fd4f0d219857c9f66c32b Mon Sep 17 00:00:00 2001 From: Michael Scott Asato Cuthbert Date: Wed, 18 Sep 2024 12:31:30 -1000 Subject: [PATCH] Fix lint (and readme, thanks Greg!) --- README.md | 2 +- .../usersGuide/usersGuide_14_timeSignatures.ipynb | 2 +- music21/tinyNotation.py | 10 ++++++---- music21/tree/verticality.py | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f5f18328c7..5be6d99150 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Maintainers will respect confidentiality with regard to reports. ## Acknowledgements ## -The early development of `music21` was been supported by +The early development of `music21` was supported by the generosity of the Seaver Institute and the National Endowment for the Humanities, along with MIT's Music and Theater Arts Section and the School of Humanities, Arts, and Social Sciences. diff --git a/documentation/source/usersGuide/usersGuide_14_timeSignatures.ipynb b/documentation/source/usersGuide/usersGuide_14_timeSignatures.ipynb index 24b7d6fc47..b36a5d1666 100644 --- a/documentation/source/usersGuide/usersGuide_14_timeSignatures.ipynb +++ b/documentation/source/usersGuide/usersGuide_14_timeSignatures.ipynb @@ -913,7 +913,7 @@ ], "source": [ "for n in alto.recurse().notes:\n", - " n.stemDirection = None\n", + " n.stemDirection = 'unspecified'\n", "\n", "alto.show()" ] diff --git a/music21/tinyNotation.py b/music21/tinyNotation.py index 3eff7b0fe2..e4c15633ae 100644 --- a/music21/tinyNotation.py +++ b/music21/tinyNotation.py @@ -301,8 +301,8 @@ def affectTokenBeforeParse(self, tokenStr: str) -> str: def affectTokenAfterParseBeforeModifiers( self, - m21Obj: base.Music21Object - ) -> base.Music21Object: + m21Obj: Music21Object + ) -> Music21Object: ''' called after the object has been acquired but before modifiers have been applied. ''' @@ -310,8 +310,8 @@ def affectTokenAfterParseBeforeModifiers( def affectTokenAfterParse( self, - m21Obj: base.Music21Object - ) -> base.Music21Object: + m21Obj: Music21Object + ) -> Music21Object: ''' called to modify the tokenObj after parsing @@ -324,6 +324,8 @@ def affectTokenAfterParse( self.end() # this is a hack that should be done away with... p = self.parent + if p is None: + return m21Obj # I thought this was potentially O(n^2) but it's actually # just O(n) on activeStates and on pop() operation. diff --git a/music21/tree/verticality.py b/music21/tree/verticality.py index 0f5fd9f41a..fba1046cde 100644 --- a/music21/tree/verticality.py +++ b/music21/tree/verticality.py @@ -786,7 +786,7 @@ def newNote(ts: spans.PitchedTimespan, n: note.Note) -> note.Note: nNew.pitch = n.pitch if nNew.stemDirection != 'noStem': - nNew.stemDirection = None + nNew.stemDirection = 'unspecified' if not addTies: return nNew