Skip to content

Remove v11 deprecations, and update pending deprecations#1919

Merged
mscuthbert merged 2 commits into
masterfrom
worktree-v11-deprecation
Jun 17, 2026
Merged

Remove v11 deprecations, and update pending deprecations#1919
mscuthbert merged 2 commits into
masterfrom
worktree-v11-deprecation

Conversation

@mscuthbert

Copy link
Copy Markdown
Member

Removed (were deprecated for removal in v11)

  • midi.translate.midiEventsToInstrument — use midiEventToInstrument
  • stream.Stream.hasElement — use el in stream
  • musicxml.xmlToM21.MeasureParser.identificationToMetadata — use
    addIdentificationToMetadata
  • string input to MeasureParser.getStaffNumber (the lazy int(str) coercion)

Deprecations now active in v11

  • stream.Stream.hasElementOfClass — use if self.getElementsByClass(className):
  • variant.addVariant's replacementDuration keyword and
    Variant._setReplacementDuration

AI-assisted (Claude)

Now that the tree is on 11.0.0b1, clear out everything that was marked for
removal in v11 and turn on the deprecations slated to start warning in v11.

Removed (were deprecated for removal in v11):
- midi.translate.midiEventsToInstrument (use midiEventToInstrument)
- stream.Stream.hasElement (use `el in stream`)
- musicxml.xmlToM21.MeasureParser.identificationToMetadata
  (use addIdentificationToMetadata)
- string input to MeasureParser.getStaffNumber

Deprecations now active in v11:
- stream.Stream.hasElementOfClass: decorated @deprecated('v11', 'v12') and
  reimplemented as bool(self.getElementsByClass(className)); internal callers
  in sites.py and variant.py tests updated to the new idiom. getElementsByClass
  docs gained guidance on bool()/if/s[Class] membership testing.
- variant.addVariant's replacementDuration keyword and
  Variant._setReplacementDuration now emit Music21DeprecationWarning
  (reads stay silent; the getter cannot warn without spurious firing).

Doc-only:
- tree.fromStream: "to be DEPRECATED" retargeted from v11 to v12.

AI-assisted (Claude)
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage is 93.071%worktree-v11-deprecation into master. No base build found for master.

@mscuthbert mscuthbert merged commit 2361ecb into master Jun 17, 2026
8 checks passed
@mscuthbert mscuthbert deleted the worktree-v11-deprecation branch June 17, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants