-
Notifications
You must be signed in to change notification settings - Fork 0
Sourcery refactored master branch #1
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
base: master
Are you sure you want to change the base?
Conversation
| sedoc = {} | ||
| for k in codes: | ||
| sedoc[codes[k]] = k | ||
| sedoc = {codes[k]: k for k in codes} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 506-508 refactored with the following changes:
- Convert for loop into dictionary comprehension (
dict-comprehension)
| totalNumOf = totalNumOf + numOf | ||
| totalTimeOf = totalTimeOf + timeOf | ||
| totalNumOf += numOf | ||
| totalTimeOf += timeOf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function registrationsFromFile refactored with the following changes:
- Replace assignment with augmented assignment (
aug-assign)
| isOrd = True | ||
| for (left, right) in deps: | ||
| if module == left: | ||
| if right not in ordered: | ||
| # It's not already ordered, so this is not this order | ||
| isOrd = False | ||
| isOrd = not any(module == left and right not in ordered | ||
| for (left, right) in deps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function nextOrder refactored with the following changes:
- Merge nested if conditions (
merge-nested-ifs) - Use any() instead of for loop (
use-any)
| isGen = True | ||
| for (left, right) in deps: | ||
| if module == right: | ||
| if left not in gened: | ||
| isGen = False | ||
| isGen = not any(module == right and left not in gened | ||
| for (left, right) in deps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function nextGeneration refactored with the following changes:
- Merge nested if conditions (
merge-nested-ifs) - Use any() instead of for loop (
use-any)
| sedoc = {} | ||
| for k in codes: | ||
| sedoc[codes[k]] = k | ||
| sedoc = {codes[k]: k for k in codes} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 506-508 refactored with the following changes:
- Convert for loop into dictionary comprehension (
dict-comprehension)
|
|
||
| boost = (0,1,4,5,16,17,20,21) | ||
| ret = '' | ||
| for i in range(precision): | ||
| for _ in range(precision): | ||
| ret+=_base32[(boost[a&7]+(boost[b&3]<<1))&0x1F] | ||
| t = a>>3 | ||
| a = b>>2 | ||
| b = t | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function _encode_i2c refactored with the following changes:
- Replace unused for index with underscore (
for-index-underscore)
| lon = lon<<3 | ||
| lat = lat<<2 | ||
| lon <<= 3 | ||
| lat <<= 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function _decode_c2i refactored with the following changes:
- Replace assignment with augmented assignment (
aug-assign)
| i = 0 | ||
| for csv in self.csvs: | ||
| i = i + 1 | ||
| i += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function PpidCounts2KML.run refactored with the following changes:
- Replace assignment with augmented assignment (
aug-assign)
Sourcery Code Quality Report (beta)✅ Merging this PR will increase code quality in the affected files by 0.06 out of 10.
Here are some functions in these files that still need a tune-up:
We are actively working on this report - lots more documentation and extra metrics to come! |
Branch
masterrefactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
masterbranch, then run: