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

Fix all flake8 errors in satpy package code #515

Merged
merged 6 commits into from
Nov 25, 2018

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Nov 24, 2018

I ran flake8 satpy from the root of the repository and got a lot of errors. I walked through these errors and fixed all but one of them. All of them were style changes except one.

The one I didn't fix is the li_l2 reader which hasn't been migrated to xarray/dask yet. Instead of removing the failing import I added the reader to the ignored paths in setup.cfg.

The only non-style change was in the mitiff writer (@TAlonglong) where there were bare except statements (except:). I changed these to except (KeyError, ValueError, RuntimeError): to make flake8 happy and hopefully not change any functionality of the writer. @TAlonglong please verify that these exceptions are what you expected. Catching all errors by doing except: or except Exception: is considered bad practice.

Lastly, some of these changes were just personal preference changes, but still changes that I think go along with the conventions that @pytroll/core have talked about in the past on slack. Some were also to reduce number of broken lines now that we've agreed on 120 max line length.

@djhoese djhoese self-assigned this Nov 24, 2018
@djhoese djhoese changed the title Fix almost all flake8 errors in satpy Fix all flake8 errors in satpy Nov 24, 2018
@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 74.621% when pulling fcd71f6 on djhoese:style-fixes into c2a2a44 on pytroll:master.

@djhoese
Copy link
Member Author

djhoese commented Nov 24, 2018

Wow I really thought I would have gotten more than 0.06% coverage increase.

@codecov
Copy link

codecov bot commented Nov 24, 2018

Codecov Report

Merging #515 into master will increase coverage by 0.05%.
The diff coverage is 68.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #515      +/-   ##
==========================================
+ Coverage   74.56%   74.62%   +0.05%     
==========================================
  Files         136      136              
  Lines       18400    18342      -58     
==========================================
- Hits        13720    13687      -33     
+ Misses       4680     4655      -25
Impacted Files Coverage Δ
satpy/readers/ghrsst_osisaf.py 23.88% <ø> (ø) ⬆️
satpy/tests/reader_tests/test_hdf4_utils.py 92.06% <ø> (ø) ⬆️
satpy/readers/acspo.py 85.71% <ø> (ø) ⬆️
satpy/composites/crefl_utils.py 83.33% <ø> (-0.3%) ⬇️
satpy/tests/reader_tests/test_msg_base.py 95% <ø> (+10.38%) ⬆️
satpy/tests/reader_tests/test_utils.py 71.87% <ø> (-0.29%) ⬇️
satpy/tests/reader_tests/test_netcdf_utils.py 93.24% <ø> (ø) ⬆️
satpy/tests/test_file_handlers.py 97.1% <ø> (-0.05%) ⬇️
satpy/tests/writer_tests/test_mitiff.py 95.55% <ø> (-0.28%) ⬇️
satpy/tests/reader_tests/test_hdf5_utils.py 92.64% <ø> (ø) ⬆️
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c2a2a44...fcd71f6. Read the comment docs.

@djhoese djhoese changed the title Fix all flake8 errors in satpy Fix all flake8 errors in satpy package code Nov 25, 2018
@djhoese djhoese merged commit 6e5ec68 into pytroll:master Nov 25, 2018
@djhoese djhoese deleted the style-fixes branch November 25, 2018 22:01
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.

Flake8-ify all of satpy
3 participants