-
Notifications
You must be signed in to change notification settings - Fork 433
Fix pylint recommendations #1694
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2828,8 +2828,7 @@ def insertAndShift(self, offsetOrItemOrList, itemOrNone=None): | |
| o = insertList[i] | ||
| e = insertList[i + 1] | ||
| qL = e.duration.quarterLength | ||
| if o + qL > highestTimeInsert: | ||
| highestTimeInsert = o + qL | ||
| highestTimeInsert = max(highestTimeInsert, o + qL) | ||
| if lowestOffsetInsert is None or o < lowestOffsetInsert: | ||
| lowestOffsetInsert = o | ||
| i += 2 | ||
|
|
@@ -8425,8 +8424,7 @@ def highestTime(self): | |
| for e in self._elements: | ||
| candidateOffset = (self.elementOffset(e) | ||
| + e.duration.quarterLength) | ||
| if candidateOffset > highestTimeSoFar: | ||
| highestTimeSoFar = candidateOffset | ||
| highestTimeSoFar = max(highestTimeSoFar, candidateOffset) | ||
| self._cache['HighestTime'] = opFrac(highestTimeSoFar) | ||
| return self._cache['HighestTime'] | ||
|
|
||
|
|
@@ -11183,10 +11181,7 @@ def makeVoices(self, *, inPlace=False, fillGaps=True): | |
| # environLocal.printDebug(['makeVoices(): olDict', olDict]) | ||
| # find the max necessary voices by finding the max number | ||
| # of elements in each group; these may not all be necessary | ||
| maxVoiceCount = 1 | ||
| for group in olDict.values(): | ||
| if len(group) > maxVoiceCount: | ||
| maxVoiceCount = len(group) | ||
| maxVoiceCount = max([len(group) for group in olDict.values()] + [1]) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| if maxVoiceCount == 1: # nothing to do here | ||
| if not inPlace: | ||
| return returnObj | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.