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

pep8 #29

Merged
merged 9 commits into from
Sep 27, 2017
Merged

pep8 #29

merged 9 commits into from
Sep 27, 2017

Conversation

brennv
Copy link
Contributor

@brennv brennv commented Sep 14, 2017

Any time when suggesting pep8 changes we are reminded of this. With that in mind, I'd like to suggest some aesthetic changes for convention and maintainability. In our Travis runs we check pep8 compliance as the last step. The last results before this PR are shown here:

https://travis-ci.org/linkedin/luminol/jobs/273116296#L663

This first commit serves only to make imports more explicit. It resolves all the warnings that read: W0401 'from luminol.constants import *' used; unable to detect undefined names [pyflakes]

I'd like to add additional commits to this PR if folks are open to it.

Caused by the location of the copyright notices
fixes W0611 warnings
@brennv
Copy link
Contributor Author

brennv commented Sep 14, 2017

Also removed unused imports and updated travis. We are now down to these issues:

src/luminol/utils.py:24:1: E302 expected 2 blank lines, found 1 [pycodestyle]
src/luminol/utils.py:48:1: E0602 undefined name 'unicode' [pyflakes]
src/luminol/utils.py:74:5: E722 do not use bare except' [pycodestyle]
src/luminol/utils.py:79:13: E722 do not use bare except' [pycodestyle]
src/luminol/__init__.py:18:3: E111 indentation is not a multiple of four [pycodestyle]
src/luminol/__init__.py:31:3: E114 indentation is not a multiple of four (comment) [pycodestyle]
src/luminol/__init__.py:32:3: E111 indentation is not a multiple of four [pycodestyle]
src/luminol/__init__.py:39:7: E111 indentation is not a multiple of four [pycodestyle]
src/luminol/__init__.py:41:7: E111 indentation is not a multiple of four [pycodestyle]
src/luminol/__init__.py:45:3: E111 indentation is not a multiple of four [pycodestyle]
src/luminol/correlator.py:93:5: E303 too many blank lines (2) [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/all.py:13:5: E128 continuation line under-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/all.py:14:5: E128 continuation line under-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/sign_test.py:41:30: E127 continuation line over-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/sign_test.py:42:30: E127 continuation line over-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/sign_test.py:43:30: E127 continuation line over-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/sign_test.py:44:30: E127 continuation line over-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/sign_test.py:45:30: E127 continuation line over-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/sign_test.py:96:89: E127 continuation line over-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/sign_test.py:97:89: E127 continuation line over-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/sign_test.py:98:89: E127 continuation line over-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/sign_test.py:99:89: E127 continuation line over-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/sign_test.py:100:89: E127 continuation line over-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/bitmap_detector.py:37:9: E128 continuation line under-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/bitmap_detector.py:37:9: E125 continuation line with same indent as next logical line [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/bitmap_detector.py:66:13: E129 visually indented line with same indent as next logical line [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/absolute_threshold.py:13:1: W0611 'luminol.utils' imported but unused [pyflakes]
src/luminol/algorithms/anomaly_detector_algorithms/absolute_threshold.py:24:30: E127 continuation line over-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/absolute_threshold.py:39:102: E127 continuation line over-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/default_detector.py:45:70: E127 continuation line over-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/__init__.py:15:22: E127 continuation line over-indented for visual indent [pycodestyle]
src/luminol/tests/test_anomaly_detector.py:72:27: E128 continuation line under-indented for visual indent [pycodestyle]
src/luminol/tests/test_anomaly_detector.py:73:27: E128 continuation line under-indented for visual indent [pycodestyle]
src/luminol/tests/test_anomaly_detector.py:74:27: E128 continuation line under-indented for visual indent [pycodestyle]
src/luminol/tests/test_anomaly_detector.py:81:27: E128 continuation line under-indented for visual indent [pycodestyle]
src/luminol/tests/test_anomaly_detector.py:239:5: E303 too many blank lines (2) [pycodestyle]
src/luminol/tests/test_anomaly_detector.py:386:1: E302 expected 2 blank lines, found 1 [pycodestyle]
src/luminol/tests/test_anomaly_detector.py:430:1: E305 expected 2 blank lines after class or function definition, found 1 [pycodestyle]
src/luminol/tests/test_correlator.py:107:1: E305 expected 2 blank lines after class or function definition, found 1 [pycodestyle]
src/luminol/modules/time_series.py:150:1: C901 'TimeSeries._generic_binary_op' is too complex (14) [mccabe]

@brennv
Copy link
Contributor Author

brennv commented Sep 14, 2017

After tidying up most whitespace issues we are down to these issues:

src/luminol/utils.py:49:1: E0602 undefined name 'unicode' [pyflakes]
src/luminol/utils.py:75:5: E722 do not use bare except' [pycodestyle]
src/luminol/utils.py:80:13: E722 do not use bare except' [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/all.py:13:5: E128 continuation line under-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/all.py:14:5: E128 continuation line under-indented for visual indent [pycodestyle]
src/luminol/algorithms/anomaly_detector_algorithms/bitmap_detector.py:66:13: E129 visually indented line with same indent as next logical line [pycodestyle]
src/luminol/modules/time_series.py:150:1: C901 'TimeSeries._generic_binary_op' is too complex (14) [mccabe]

For these linter issues: E302, E303, E305, 
E111, E114, E125, E127, E128, E129
for linter issue E722
for linter E128
for linter issue E129
py3 lint undefined name 'unicode'
@brennv
Copy link
Contributor Author

brennv commented Sep 15, 2017

The warnings have been reduced to this issue:

src/luminol/modules/time_series.py:150:1: C901 'TimeSeries._generic_binary_op' is too complex (14) [mccabe]

The repeated code could be abstracted into another function to resolve this, but it's safe to ignore.

@bdewilde
Copy link

Hi @brennv , guess it's time for me to nudge somebody at LinkedIn... 😀

@RiteshMaheshwari , you're the only one who's been responding, but I'm more than happy to ping somebody else. It would be great to get this PR (plus the two others) reviewed and merged.

Copy link
Contributor

@RiteshMaheshwari RiteshMaheshwari left a comment

Choose a reason for hiding this comment

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

LGTM

@RiteshMaheshwari RiteshMaheshwari merged commit d58abe1 into linkedin:master Sep 27, 2017
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.

None yet

3 participants