Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pylint recommendations #1694

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

TimFelixBeyer
Copy link
Contributor

Pylint now recommends using yield from and the use of min/max to simplify if statements.

Pylint now recommends using `yield from` and the use of `min/max` to simplify if statements.
@coveralls
Copy link

coveralls commented Mar 3, 2024

Coverage Status

coverage: 93.032% (+0.001%) from 93.031%
when pulling c7c439b on TimFelixBeyer:lint-fix
into f2f7bad on cuthbertLab:master.

music21/analysis/reduceChords.py Outdated Show resolved Hide resolved
music21/analysis/reduceChordsOld.py Outdated Show resolved Hide resolved
music21/braille/text.py Outdated Show resolved Hide resolved
music21/figuredBass/realizer.py Show resolved Hide resolved
for group in olDict.values():
if len(group) > maxVoiceCount:
maxVoiceCount = len(group)
maxVoiceCount = max([len(group) for group in olDict.values()] + [1])
Copy link
Member

Choose a reason for hiding this comment

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

This isn't necessarily better than the prior version, so although it's not worth reverting, it might have been worth adding a disable. To keep in mind for future lint additions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, I'm pretty sure there should be a simpler option (maybe max([..], default=1), which would be ok if we know at least one group is not empty), but I wasn't able to confirm it quickly.

music21/voiceLeading.py Show resolved Hide resolved
music21/voiceLeading.py Show resolved Hide resolved
Copy link
Member

@jacobtylerwalls jacobtylerwalls left a comment

Choose a reason for hiding this comment

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

Great, appreciate your help keeping the pipeline green!

@jacobtylerwalls jacobtylerwalls merged commit dbd8c9f into cuthbertLab:master Mar 4, 2024
7 checks passed
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.

3 participants