-
Notifications
You must be signed in to change notification settings - Fork 6
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 Starbot ⭐ refactored jason-neal/eniric #158
base: master
Are you sure you want to change the base?
Conversation
if (num_cpu is None) or (num_cpu == 1): | ||
num_cpu_minus_1 = 1 | ||
else: | ||
num_cpu_minus_1 = num_cpu - 1 | ||
return num_cpu_minus_1 | ||
return 1 if (num_cpu is None) or (num_cpu == 1) else num_cpu - 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 cpu_minus_one refactored with the following changes:
- Replace if statement with if expression
- Inline variable that is only used once
if test_spec[2] is not None: | ||
if mask is not None: |
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 test_relation_of_rv_to_sqrtsumwis refactored with the following changes:
- Use previously assigned local variable
data1 = range(5) | ||
data2 = range(5, 10) | ||
bad_data = range(6) # Different length | ||
|
||
# test uneven data lengths | ||
with pytest.raises(ValueError): | ||
data1 = range(5) | ||
data2 = range(5, 10) | ||
bad_data = range(6) # Different length | ||
|
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 test_write_col_errors_different_length refactored with the following changes:
- Move assignments closer to their usage
data1 = range(5) | ||
data2 = range(5, 10) | ||
bad_data = range(6) # Different length | ||
|
||
# test bad header | ||
with pytest.raises(ValueError): | ||
data1 = range(5) | ||
data2 = range(5, 10) | ||
bad_data = range(6) # Different length | ||
|
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 test_write_col_errors refactored with the following changes:
- Move assignments closer to their usage
data1 = range(5) | ||
|
||
with pytest.raises(TypeError): |
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 test_write_col_errors_bad_keyword refactored with the following changes:
- Move assignments closer to their usage
wave = request.param | ||
return wave | ||
return request.param |
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 wavelength refactored with the following changes:
- Inline variable that is only used once
Here is an overview of what got changed by this pull request: Complexity increasing per file
==============================
- eniric/atmosphere.py 1
Complexity decreasing per file
==============================
+ scripts/precision_four_panel.py -3
+ eniric/snr_normalization.py -1
See the complete overview on Codacy |
Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨
Here's your pull request refactoring your most popular Python repo.
If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.
Review changes via command line
To manually merge these changes, make sure you're on the
master
branch, then run: