-
Notifications
You must be signed in to change notification settings - Fork 4
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 pranathivemuri/vessels-ct-radius #1
base: master
Are you sure you want to change the base?
Conversation
raise ValueError("Given radius '{}' does not fit in cube edge length {}" | ||
.format(radius, cube_edge)) | ||
raise ValueError( | ||
f"Given radius '{radius}' does not fit in cube edge length {cube_edge}" | ||
) |
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 vessel_diagonal
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
assert similarity >= accuracy, \ | ||
"Binmask similarity {} < target accuracy {}".format(similarity, accuracy) | ||
assert ( | ||
similarity >= accuracy | ||
), f"Binmask similarity {similarity} < target accuracy {accuracy}" |
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 assert_binmask_similar
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
boundary_image = binary_image - erode_image | ||
return boundary_image | ||
return binary_image - erode_image |
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 get_boundaries_of_image
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
dict_nodes_radius = {item: eucledian_radius_image[item] for item in list_nzi} | ||
return dict_nodes_radius | ||
return {item: eucledian_radius_image[item] for item in list_nzi} |
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 get_radius_2d
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
dict_nodes_radius.update(new_d) | ||
dict_nodes_radius |= new_d |
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 get_radius_slicewise
refactored with the following changes:
- Merge dictionary updates via the union operator (
dict-assign-update-to-union
)
max_dict = {} | ||
for key, val in list_of_dicts[0].items(): | ||
max_dict[key] = max(list_of_dicts[i][key] for i in range(len(list_of_dicts))) | ||
return max_dict | ||
return { | ||
key: max(list_of_dicts[i][key] for i in range(len(list_of_dicts))) | ||
for key, val in list_of_dicts[0].items() | ||
} |
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 get_max_dict
refactored with the following changes:
- Convert for loop into dictionary comprehension (
dict-comprehension
) - Inline variable that is immediately returned (
inline-immediately-returned-variable
)
dict_nodes_radius = get_max_dict(d) | ||
return dict_nodes_radius | ||
return get_max_dict(d) |
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 get_radius_3d
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
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: