Navigation Menu

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 fixes on dates.py #1398

Merged
merged 1 commit into from Dec 6, 2012
Merged

PEP8 fixes on dates.py #1398

merged 1 commit into from Dec 6, 2012

Conversation

NelleV
Copy link
Member

@NelleV NelleV commented Oct 14, 2012

PEP8 fixes on the module dates.

Thanks,
N

@dmcdougall
Copy link
Member

+1


dt = datetime.datetime(1011, 10, 9, 13, 44, 22, 101010, tzinfo=tz)
x = date2num(dt)
_close_to_dt(dt, num2date(x, tz))
Copy link
Member

Choose a reason for hiding this comment

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

Is it worth turning this into a regression test?

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 don't know what pytz is. Any insight on this ?

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 found it...

@pelson
Copy link
Member

pelson commented Dec 6, 2012

👍 - congratulations @NelleV, I think this is the last PEP8 PR remaining. I take my hat off to you for doing this, you've touched more lines of mpl than I dare imagine, and in doing so have really brought much of the codebase upto PEP8 whitespace standards. We still have a long way to go to be truly "PEP8" compliant (getters and setters being the biggest one), but you've put us on a path which, IMHO, is as important as all the new features of mpl combined - a consistent and more readable codebase.

@NelleV - I'm sure there are still plenty of PEP8 whitespace issues, but I wonder if you have considered implementing a PEP8 whitespace test? I have done such a thing in another project and think it is really valuable (but it does have its costs) if your interested: https://github.com/SciTools/cartopy/blob/master/lib/cartopy/tests/test_pep8.py.

Thanks again,

Phil

pelson added a commit that referenced this pull request Dec 6, 2012
@pelson pelson merged commit 47b13a0 into matplotlib:master Dec 6, 2012
@pelson
Copy link
Member

pelson commented Dec 6, 2012

Note: There are some __main__ level "tests" which might be worth converting to unit tests. Would you mind doing that as a new PR?

@mdboom
Copy link
Member

mdboom commented Dec 6, 2012

Just to second what @pelson has said: @NelleV: thanks for all the hard work. This is a significant improvement.

@dmcdougall
Copy link
Member

@pelson @mdboom This might be of interest to you.

@pelson
Copy link
Member

pelson commented Dec 6, 2012

@pelson @mdboom This might be of interest to you.

Thanks @dmcdougall - see the shiny new test I linked to in cartopy (which runs the pep8 tool as part of a test).

@dmcdougall
Copy link
Member

Ah yes, for some reason I missed the link. Thanks.

@NelleV
Copy link
Member Author

NelleV commented Dec 6, 2012

@pelson I'm working on moving the code I deleted from the file to unit tests.

I'd suggest running flake8 instead of pep8 in your tests: it runs pyflakes in addition to pep8, which allowed me to spot some bugs in the codebase without running it.

I can add this to the matplotlib test suites, or it could be run automatically as part as the travis pipeline, as well as test coverage (I don't know travis very well, so I'm not 100% sure this is possible).

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

4 participants