Skip to content

(AI) Fix makeTies fallback for missing string voice IDs - #2031

Closed
pablopupo wants to merge 1 commit into
cuthbertLab:masterfrom
pablopupo:fix/2024-make-ties-string-voice
Closed

pablopupo wants to merge 1 commit into
cuthbertLab:masterfrom
pablopupo:fix/2024-make-ties-string-voice

Conversation

@pablopupo

Copy link
Copy Markdown
Contributor

Fixes #2024. makeTies now resolves string and integer voice IDs through getElementById() and falls back to the next measure when no matching voice exists.

I used explicit None checks rather than the chained or suggested in the issue because an empty Voice is falsey; the chained form would skip a valid empty matching voice.

AI-assisted (Codex). I reviewed and tested the final change.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.355% (+0.006%) from 93.349% — pablopupo:fix/2024-make-ties-string-voice into cuthbertLab:master

@mscuthbert mscuthbert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's rather unclear that this behavior is what should be expected -- we have two measures with one voice each with no time signature. I would not guarantee that the second measure would get a rest of 1 QL in there. The test does not cover makeTies. This needs a human touch -- will not be approved w/o human interaction.

secondMeasure = stream.Measure([stream.Voice(id='1')])
part.append([firstMeasure, secondMeasure])

part.makeRests(fillGaps=True, inPlace=True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this testing makeTies? I see just makeRests here? Test what is claimed to be testing.

@pablopupo pablopupo closed this Sep 14, 2026
@pablopupo
pablopupo deleted the fix/2024-make-ties-string-voice branch September 14, 2026 22:56
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.

makeTies raises KeyError when bridging a string voice id absent from the next measure

3 participants