Sourcery Starbot ⭐ refactored bm424/scikit-cmeans#2
Open
SourceryAI wants to merge 1 commit into
Open
Conversation
SourceryAI
commented
Nov 10, 2022
| centers_best = None | ||
| iterator = range(self.n_init) | ||
| for i in iterator: | ||
| for _ in iterator: |
Author
There was a problem hiding this comment.
Function CMeans.fit refactored with the following changes:
- Replace unused for index with underscore (
for-index-underscore)
| if np.abs(j_old - j_new) < self.tol: | ||
| break | ||
| results = { | ||
| return { |
Author
There was a problem hiding this comment.
Function CMeans.converge refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
Comment on lines
-216
to
+215
| raise NotImplementedError("Method '{}' is not implemented.".format(method)) | ||
| raise NotImplementedError(f"Method '{method}' is not implemented.") |
Author
There was a problem hiding this comment.
Function CMeans.plot refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting)
| color = plt.cm.tab20(np.linspace(0, 1, algorithm.n_clusters)) | ||
| for j, c in zip(range(algorithm.n_clusters), color): | ||
| print("Plotting cluster {} ({})".format(j, c)) | ||
| print(f"Plotting cluster {j} ({c})") |
Author
There was a problem hiding this comment.
Function contour refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting)
| legend_handles = [] | ||
| for j, c in zip(range(algorithm.n_clusters), color): | ||
| print("Plotting cluster {} ({})".format(j, c)) | ||
| print(f"Plotting cluster {j} ({c})") |
Author
There was a problem hiding this comment.
Function scatter refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting)
| values_list = itertools.product(*param_data.values()) | ||
| params = [dict(zip(param_data.keys(), v)) for v in values_list] | ||
| return params | ||
| return [dict(zip(param_data.keys(), v)) for v in values_list] |
Author
There was a problem hiding this comment.
Function combine_param_data refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
masterbranch, then run: