Skip to content
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

STY Ensures that "flake8 ." works #20298

Merged
merged 5 commits into from Jun 18, 2021
Merged

Conversation

@thomasjpfan
Copy link
Member

@thomasjpfan thomasjpfan commented Jun 18, 2021

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

@rth
rth approved these changes Jun 18, 2021
Copy link
Member

@rth rth left a comment

Yes, I agree. Thanks!

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

This comment has been minimized.

@rth

rth Jun 18, 2021
Member

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

This comment has been minimized.

@ogrisel

ogrisel Jun 18, 2021
Member

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

This comment has been minimized.

@thomasjpfan

thomasjpfan Jun 18, 2021
Author Member

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)),

This comment has been minimized.

@rth

rth Jun 18, 2021
Member

Maybe add a line break

This comment has been minimized.

@NicolasHug

NicolasHug Jun 18, 2021
Member

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

This comment has been minimized.

@thomasjpfan

thomasjpfan Jun 18, 2021
Author Member

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

Copy link
Member

@NicolasHug NicolasHug left a comment

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)),

This comment has been minimized.

@NicolasHug

NicolasHug Jun 18, 2021
Member

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
examples/feature_selection/plot_rfe_digits.py Outdated Show resolved Hide resolved
Copy link
Member

@ogrisel ogrisel left a comment

LGTM!

doc/conftest.py Outdated Show resolved Hide resolved
@ogrisel ogrisel merged commit 81dde3a into scikit-learn:main Jun 18, 2021
24 of 26 checks passed
24 of 26 checks passed
@github-actions
check
Details
@github-actions
triage
Details
@github-actions
Check build trigger
Details
@github-actions
Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}
Details
@github-actions
triage_file_extensions
Details
@github-actions
Source distribution
Details
@github-actions
Upload to Anaconda
Details
ci/circleci: doc Your tests are queued behind your running builds
Details
ci/circleci: doc-min-dependencies Your tests are queued behind your running builds
Details
@lgtm-com
LGTM analysis: C/C++ No code changes detected
Details
@lgtm-com
LGTM analysis: JavaScript No code changes detected
Details
@lgtm-com
LGTM analysis: Python 1 fixed alert
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
@azure-pipelines
scikit-learn.scikit-learn Build #20210618.19 succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Get Git Commit) Get Git Commit succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linting) Linting succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux py37_conda_openblas) Linux py37_conda_openblas succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux pylatest_pip_openblas_pandas) Linux pylatest_pip_openblas_pandas succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux ubuntu_atlas) Linux ubuntu_atlas succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux32 debian_atlas_32bit) Linux32 debian_atlas_32bit succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux_Runs pylatest_conda_mkl) Linux_Runs pylatest_conda_mkl succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Ubuntu_Bionic py37_conda) Ubuntu_Bionic py37_conda succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Windows py37_conda_mkl) Windows py37_conda_mkl succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Windows py37_pip_openblas_32bit) Windows py37_pip_openblas_32bit succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (macOS pylatest_conda_forge_mkl) macOS pylatest_conda_forge_mkl succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (macOS pylatest_conda_mkl_no_openmp) macOS pylatest_conda_mkl_no_openmp succeeded
Details
@ogrisel
Copy link
Member

@ogrisel ogrisel commented Jun 18, 2021

Merged!

@ogrisel
Copy link
Member

@ogrisel 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
Linked issues

Successfully merging this pull request may close these issues.

4 participants