From 896ba177cae81d50f0045d9008bc31f4ecd12268 Mon Sep 17 00:00:00 2001 From: Michael Scott Asato Cuthbert Date: Tue, 24 Feb 2026 11:10:02 -1000 Subject: [PATCH 1/3] Fill instrument abbreviation TODOs (AI-Assisted) --- music21/instrument.py | 46 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/music21/instrument.py b/music21/instrument.py index a4ffa68c8..898010db0 100644 --- a/music21/instrument.py +++ b/music21/instrument.py @@ -456,7 +456,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Reed Organ' - # TODO self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'R Org' self.midiProgram = 20 self.instrumentSound = 'keyboard.organ.reed' @@ -681,7 +681,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Fretless Bass' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Fretl b' self.midiProgram = 35 self.instrumentSound = 'pluck.bass.fretless' @@ -752,7 +752,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Shamisen' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Shmsn' self.instrumentSound = 'pluck.shamisen' self.midiProgram = 106 @@ -762,7 +762,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Koto' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Koto' self.instrumentSound = 'pluck.koto' self.midiProgram = 107 @@ -1248,7 +1248,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Handbells' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Hbells' self.instrumentSound = 'pitched-percussion.handbells' @@ -1257,7 +1257,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Dulcimer' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Dlc' self.instrumentSound = 'pluck.dulcimer' self.midiProgram = 15 @@ -1333,7 +1333,7 @@ def __init__(self, **keywords): self.instrumentName = 'Maracas' self.inGMPercMap = True self.percMapPitch = 70 - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Mrcs' self.instrumentSound = 'rattle.maraca' @@ -1391,7 +1391,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Suspended Cymbal' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Sus Cym' self.instrumentSound = 'metal.cymbal.suspended' @@ -1400,7 +1400,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Sizzle Cymbal' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Siz Cym' self.instrumentSound = 'metal.cymbal.sizzle' @@ -1409,7 +1409,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Splash Cymbals' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Spl Cym' self.instrumentSound = 'metal.cymbal.splash' @@ -1418,7 +1418,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Ride Cymbals' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Ride Cym' self.instrumentSound = 'metal.cymbal.ride' @@ -1442,7 +1442,7 @@ def __init__(self, **keywords): } self.percMapPitch = self._modifierToPercMapPitch[self._modifier] - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Hi-Hat' class Triangle(UnpitchedPercussion): @@ -1480,7 +1480,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Agogo' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Ago' self.instrumentSound = 'metal.bells.agogo' self.inGMPercMap = True self.percMapPitch = 67 @@ -1492,7 +1492,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Tam-Tam' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Tam-t' self.instrumentSound = 'metal.tamtam' @@ -1501,7 +1501,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Sleigh Bells' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Slgh Bl' self.instrumentSound = 'metal.bells.sleigh-bells' @@ -1554,7 +1554,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Tom-Tom' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Tom' self.instrumentSound = 'drum.tom-tom' self.inGMPercMap = True self._modifier = 'low floor' @@ -1612,7 +1612,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Taiko' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Tko' self.instrumentSound = 'drum.taiko' self.midiProgram = 116 @@ -1633,7 +1633,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Whip' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Whip' self.instrumentSound = 'effect.whip' @@ -1642,7 +1642,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Ratchet' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Ratc' self.instrumentSound = 'rattle.ratchet' @@ -1651,7 +1651,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Siren' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Siren' self.instrumentSound = 'effect.siren' @@ -1669,7 +1669,7 @@ def __init__(self, **keywords): super().__init__(**keywords) self.instrumentName = 'Wind Machine' - # TODO: self.instrumentAbbreviation = '' + self.instrumentAbbreviation = 'Wind Mach' self.instrumentSound = 'effect.wind' @@ -2009,7 +2009,7 @@ def deduplicate(s: stream.Stream, inPlace: bool = False) -> stream.Stream: 73: Flute, 74: Recorder, 75: PanFlute, - 76: PanFlute, # TODO 76: Bottle + 76: PanFlute, # TODO: 76: Bottle 77: Shakuhachi, 78: Whistle, 79: Ocarina, @@ -2060,7 +2060,7 @@ def deduplicate(s: stream.Stream, inPlace: bool = False) -> stream.Stream: 124: Sampler, 125: Sampler, 126: Sampler, - 127: Sampler + 127: Sampler, } From 16284c4dce86061192f5d0d10b2ca7ac5a30632e Mon Sep 17 00:00:00 2001 From: Michael Scott Asato Cuthbert Date: Tue, 24 Feb 2026 11:32:47 -1000 Subject: [PATCH 2/3] little fixes (myke) --- music21/instrument.py | 2 +- music21/test/multiprocessTest.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/music21/instrument.py b/music21/instrument.py index 898010db0..778039bce 100644 --- a/music21/instrument.py +++ b/music21/instrument.py @@ -2045,7 +2045,7 @@ def deduplicate(s: stream.Stream, inPlace: bool = False) -> stream.Stream: 109: Bagpipes, 110: Violin, # TODO: instrumentSound 111: Shehnai, - 112: Glockenspiel, # TODO 112: Tinkle Bell + 112: Glockenspiel, # TODO: 112: Tinkle Bell 113: Agogo, 114: SteelDrum, 115: Woodblock, diff --git a/music21/test/multiprocessTest.py b/music21/test/multiprocessTest.py index a63251a48..bfec2e3de 100644 --- a/music21/test/multiprocessTest.py +++ b/music21/test/multiprocessTest.py @@ -165,7 +165,7 @@ def mainPoolRunner(testGroup=('test',), restoreEnvironmentDefaults=False, leaveO eventsProcessed = 0 summaryOutput = [] - while continueIt is True: + while continueIt: try: newResult = res.next(timeout=1) if timeouts >= 5: From f35f7d867e71ca427b3c68d770e3d732ff116d7a Mon Sep 17 00:00:00 2001 From: Michael Scott Asato Cuthbert Date: Tue, 24 Feb 2026 11:32:58 -1000 Subject: [PATCH 3/3] Fix module-name parsing and remove stale pip cache (AI-Assisted) - fix ModuleGather._getNamePeriod to strip only the file extension suffix - remove setup-python pip cache settings from maincheck jobs that use uv cache --- .github/workflows/maincheck.yml | 3 --- music21/test/commonTest.py | 9 +++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/maincheck.yml b/.github/workflows/maincheck.yml index 25bc3c8b5..272d8b5ac 100644 --- a/.github/workflows/maincheck.yml +++ b/.github/workflows/maincheck.yml @@ -50,7 +50,6 @@ jobs: uses: actions/setup-python@v4 with: python-version: '3.14' - cache: 'pip' - name: Install uv uses: astral-sh/setup-uv@v7 with: @@ -76,7 +75,6 @@ jobs: uses: actions/setup-python@v4 with: python-version: '3.14' - cache: 'pip' - name: Install uv uses: astral-sh/setup-uv@v7 with: @@ -99,7 +97,6 @@ jobs: uses: actions/setup-python@v4 with: python-version: '3.14' - cache: 'pip' - name: Install uv uses: astral-sh/setup-uv@v7 with: diff --git a/music21/test/commonTest.py b/music21/test/commonTest.py index c8fa97f70..d473a02ab 100644 --- a/music21/test/commonTest.py +++ b/music21/test/commonTest.py @@ -348,7 +348,8 @@ def _getName(self, fp): if fn.startswith(os.sep): fn = fn[1:] fn = fn.replace(os.sep, '_') # replace w/ _ - fn = fn.replace('.py', '') + if fn.endswith('.py'): + fn = fn[:-3] return fn def _getNamePeriod(self, fp, *, addM21=False): @@ -363,11 +364,11 @@ def _getNamePeriod(self, fp, *, addM21=False): ''' fn = fp.replace(self.dirParent, '') # remove parent parts = [x for x in fn.split(os.sep) if x] - if parts[-1] == '__init__.py': + if parts[-1].endswith('.py'): + parts[-1] = parts[-1][:-3] + if parts[-1] == '__init__': parts.pop() fn = '.'.join(parts) # replace w/ period - - fn = fn.replace('.py', '') if addM21 and fn: fn = 'music21.' + fn elif addM21: