Skip to content

STY Ensures that "flake8 ." works #20298

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

Merged
merged 5 commits into from
Jun 18, 2021
Merged

Conversation

thomasjpfan
Copy link
Member

Reference Issues/PRs

Closes #20296

What does this implement/fix? Explain your changes.

I ran:

flake8 --format='%(path)s' examples | uniq | xargs autopep8 --ignore E402 -i

And did a few manual adjustments. I do not think there are many recent PRs that touch these lines, so I think it is okay to fix these for flake8.

CC @rth

Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

Yes, I agree. Thanks!

Comment on lines 84 to 85
ax1 = plt.subplot2grid((3, 1), (0, 0), rowspan=2)
ax2 = plt.subplot2grid((3, 1), (2, 0))
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, so we can't do fig.subplot2grid ?

Copy link
Member

Choose a reason for hiding this comment

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

what's wrong with the current code? If fig was not used, there is no point assigning this variable.

Copy link
Member Author

Choose a reason for hiding this comment

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

I do not think fig.subplot2grid exists. I added plt.subplot2grid(..., fig=fig) to be more OO.

.3 * np.random.normal(size=2),
mode='constant',
).ravel()
def shift(x): return ndimage.shift(x.reshape((8, 8)),
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a line break

Copy link
Member

Choose a reason for hiding this comment

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

I thought we told flake8 to ignore that kind of thing?

in setup.cfg we ignore:

    E731,  # do not assign a lambda expression, use a def

Copy link
Member Author

Choose a reason for hiding this comment

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

Autopep8 did its magic here. I reverted the change and just fixed this part manually

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Just questions from me but LGTM anyway, thanks Thomas

.3 * np.random.normal(size=2),
mode='constant',
).ravel()
def shift(x): return ndimage.shift(x.reshape((8, 8)),
Copy link
Member

Choose a reason for hiding this comment

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

I thought we told flake8 to ignore that kind of thing?

in setup.cfg we ignore:

    E731,  # do not assign a lambda expression, use a def

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

LGTM!

@ogrisel ogrisel merged commit 81dde3a into scikit-learn:main Jun 18, 2021
@ogrisel
Copy link
Member

ogrisel commented Jun 18, 2021

Merged!

@ogrisel
Copy link
Member

ogrisel commented Jun 18, 2021

Circle CI was still running but the lint step was already green.

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

Successfully merging this pull request may close these issues.

Fix flake8 in examples
4 participants