-
Notifications
You must be signed in to change notification settings - Fork 0
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 #10
base: master
Are you sure you want to change the base?
Conversation
1293610
to
9a493fe
Compare
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.
Reviewing sourcery changes
38da1bd
to
12edaf8
Compare
12edaf8
to
331b255
Compare
test = True | ||
|
||
raw_sequence = reference_sequence.replace("-", "") | ||
|
||
length = len(raw_sequence) | ||
|
||
for position in sequence_feature_positions: | ||
|
||
if position > length: | ||
test = False | ||
test = all(position <= length for position in sequence_feature_positions) |
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 confirm_seq_feature_in_ref
refactored with the following changes:
- Use any() instead of for loop (
use-any
) - Invert any/all to simplify comparisons (
invert-any-all
)
test = True | ||
|
||
# check that all positions are in sequence | ||
|
||
if all(i <= seq_length for i in positions): | ||
|
||
for position in positions: | ||
|
||
if reference_sequence[position - 1] == "-": | ||
test = False | ||
|
||
return test | ||
|
||
else: | ||
if any(i > seq_length for i in positions): | ||
|
||
return False | ||
|
||
return all(reference_sequence[position - 1] != "-" for position in positions) |
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 check_reference_positions
refactored with the following changes:
- Swap if/else branches (
swap-if-else-branches
) - Invert any/all to simplify comparisons (
invert-any-all
) - Remove unnecessary else after guard condition (
remove-unnecessary-else
) - Use any() instead of for loop (
use-any
) - Inline variable that is immediately returned (
inline-immediately-returned-variable
)
vt_id = "VT-%03d" % (i,) | ||
|
||
return vt_id | ||
return "VT-%03d" % (i,) |
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 vt_count
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
df_selected = df[df['VT'].isin(vts_to_select)] | ||
return df_selected | ||
return df[df['VT'].isin(vts_to_select)] |
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 select_var_types_to_plot
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
sequence_feature_temp = ''.join([sequence[index] for index in vt_positions]) | ||
sequence_feature_temp = ''.join(sequence[index] for index in vt_positions) |
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 compute_variant_types
refactored with the following changes:
- Replace unneeded comprehension with generator (
comprehension-to-generator
)
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 0.03%.
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! |
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!