-
Notifications
You must be signed in to change notification settings - Fork 82
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
Sourcery refactored master branch #23
base: master
Are you sure you want to change the base?
Conversation
file_format = sf.format_info + ' ' + sf.subtype_info | ||
file_format = f'{sf.format_info} {sf.subtype_info}' |
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 analyze
refactored with the following changes:
- Simplify conditional into switch-like form [×11] (
switch
) - Use f-string instead of string concatenation [×4] (
use-fstring-for-concatenation
) - Replace call to format with f-string (
use-fstring-for-formatting
)
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.
This just re-orders the conditionals to put pass
first? 🤔
soundfile['format'] = sf.format_info + ' ' + sf.subtype_info | ||
soundfile['format'] = f'{sf.format_info} {sf.subtype_info}' |
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 load_dict
refactored with the following changes:
- Simplify conditional into switch-like form [×2] (
switch
) - Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation
)
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.
@sourcery-ai I don't see a "simplify conditional" in this file.
responses = {} | ||
|
||
# ANSI S1.4-1983 Table AI "A weighting" | ||
responses['A'] = np.array((-70.4, -63.4, -56.7, -50.5, -44.7, -39.4, -34.6, | ||
-30.2, -26.2, -22.5, -19.1, -16.1, -13.4, -10.9, | ||
-8.6, -6.6, -4.8, -3.2, -1.9, -0.8, 0.0, +0.6, | ||
+1.0, +1.2, +1.3, +1.2, +1.0, +0.5, -0.1, -1.1, | ||
-2.5, -4.3, -6.6, -9.3, -12.4, -15.8, -19.3, -23.1, | ||
-26.9, -30.8, -34.7, | ||
)) |
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 28-37
refactored with the following changes:
- Merge dictionary assignment with declaration (
merge-dict-assign
)
This removes the following comments ( why? ):
# ANSI S1.4-1983 Table AI "A weighting"
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.
no, bad
Sourcery Code Quality Report❌ Merging this PR will decrease code quality in the affected files by 0.24%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
responses = {} | ||
|
||
# ANSI S1.4-1983 Table AI "A weighting" | ||
responses['A'] = np.array((-70.4, -63.4, -56.7, -50.5, -44.7, -39.4, -34.6, | ||
-30.2, -26.2, -22.5, -19.1, -16.1, -13.4, -10.9, | ||
-8.6, -6.6, -4.8, -3.2, -1.9, -0.8, 0.0, +0.6, | ||
+1.0, +1.2, +1.3, +1.2, +1.0, +0.5, -0.1, -1.1, | ||
-2.5, -4.3, -6.6, -9.3, -12.4, -15.8, -19.3, -23.1, | ||
-26.9, -30.8, -34.7, | ||
)) |
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.
no, bad
soundfile['format'] = sf.format_info + ' ' + sf.subtype_info | ||
soundfile['format'] = f'{sf.format_info} {sf.subtype_info}' |
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.
@sourcery-ai I don't see a "simplify conditional" in this file.
file_format = sf.format_info + ' ' + sf.subtype_info | ||
file_format = f'{sf.format_info} {sf.subtype_info}' |
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.
This just re-orders the conditionals to put pass
first? 🤔
Branch
master
refactored 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
master
branch, then run:Help us improve this pull request!