Skip to content

DOC: Fix PEP-8 issues in timedeltas.rst #23905

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 1 commit into from
Nov 27, 2018

Conversation

FHaase
Copy link
Contributor

@FHaase FHaase commented Nov 25, 2018

  • Replace from pandas.tseries.offsets import * with pd.offsets.<ClassName> for better readability.

@FHaase FHaase changed the title Fix PEP-8 issues in timedeltas.rst DOC: Fix PEP-8 issues in timedeltas.rst Nov 25, 2018
@codecov
Copy link

codecov bot commented Nov 25, 2018

Codecov Report

Merging #23905 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #23905   +/-   ##
=======================================
  Coverage   92.29%   92.29%           
=======================================
  Files         161      161           
  Lines       51498    51498           
=======================================
  Hits        47530    47530           
  Misses       3968     3968
Flag Coverage Δ
#multiple 90.69% <ø> (ø) ⬆️
#single 42.43% <ø> (ø) ⬆️

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 a7b187a...6bc4ce5. Read the comment docs.

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @FHaase

@jbrockmendel if you want to take a look here too

@datapythonista datapythonista added Docs Timedelta Timedelta data type Code Style Code style, linting, code_checks labels Nov 25, 2018
@jbrockmendel
Copy link
Member

This looks fine to me. Only question is if the importing of Second/Minute etc is intentional.

@datapythonista
Copy link
Member

Not sure what you mean. Replacing the from pandas.tseries.offsets import * and using the full path version of Second... is intentional, as importing * is discouraged in Python, and having the full path makes things clearer IMO, as the user know where Second and the rest are coming from. Is this what you mean?

@jbrockmendel
Copy link
Member

I would have a strong preference against * imports in actual python code, but the .rst files I'm not so familiar with, don't know if separate conventions apply there.

@FHaase
Copy link
Contributor Author

FHaase commented Nov 25, 2018

Well if someone reads the documentation finding something like Second(...) it's not clear what that class is. Is it a pandas class, where in the pandas project can it be found. Is it defined somewhere in the previous *.rst file.

By writing pd.offsets.Second(...) it's basically clear on first glance.

@jreback jreback added this to the 0.24.0 milestone Nov 27, 2018
@jreback jreback merged commit f8b6496 into pandas-dev:master Nov 27, 2018
@jreback
Copy link
Contributor

jreback commented Nov 27, 2018

thanks @FHaase

yeah more explicit the better.

@FHaase FHaase deleted the fix-pep8-timedeltas branch December 2, 2018 19:30
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks Docs Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants