Skip to content

Sourcery Starbot ⭐ refactored bm424/scikit-cmeans#2

Open
SourceryAI wants to merge 1 commit into
bm424:masterfrom
SourceryAI:master
Open

Sourcery Starbot ⭐ refactored bm424/scikit-cmeans#2
SourceryAI wants to merge 1 commit into
bm424:masterfrom
SourceryAI:master

Conversation

@SourceryAI
Copy link
Copy Markdown

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:

git fetch https://github.com/sourcery-ai-bot/scikit-cmeans master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Comment thread skcmeans/algorithms.py
centers_best = None
iterator = range(self.n_init)
for i in iterator:
for _ in iterator:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CMeans.fit refactored with the following changes:

Comment thread skcmeans/algorithms.py
if np.abs(j_old - j_new) < self.tol:
break
results = {
return {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CMeans.converge refactored with the following changes:

Comment thread skcmeans/algorithms.py
Comment on lines -216 to +215
raise NotImplementedError("Method '{}' is not implemented.".format(method))
raise NotImplementedError(f"Method '{method}' is not implemented.")
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CMeans.plot refactored with the following changes:

Comment thread skcmeans/plot.py
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})")
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function contour refactored with the following changes:

Comment thread skcmeans/plot.py
legend_handles = []
for j, c in zip(range(algorithm.n_clusters), color):
print("Plotting cluster {} ({})".format(j, c))
print(f"Plotting cluster {j} ({c})")
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function scatter refactored with the following changes:

Comment thread tests/conftest.py
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]
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function combine_param_data refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant