Skip to content

DOC: Improve docstring of Timedelta.delta #21135

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

Closed
wants to merge 13 commits into from

Conversation

chalmerlowe
Copy link
Contributor

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.pyx" | flake8 --diff
  • whatsnew entry
################################################################################
###################### Docstring (pandas.Timedelta.delta) ######################
################################################################################

Return the timedelta in nanoseconds (ns), for internal compatibility.

Returns
-------
int
    Timedelta in nanoseconds.

Examples
--------
**Using string input**

>>> td = pd.Timedelta('1 days 42 ns')
>>> td.delta
86400000000042

>>> td = pd.Timedelta('3 s')
>>> td.delta
3000000000

>>> td = pd.Timedelta('3 ms 5 us')
>>> td.delta
3005000

**Using integer input**

>>> td = pd.Timedelta(42, unit='ns')
>>> td.delta
42

################################################################################
################################## Validation ##################################
################################################################################

Errors found:
	No extended summary found
	See Also section not found

@chalmerlowe chalmerlowe changed the title Delta docstring DOC: Improve docstring of Timedelta.delta May 19, 2018
@@ -770,7 +799,48 @@ cdef class _Timedelta(timedelta):

@property
def resolution(self):
""" return a string representing the lowest resolution that we have """
"""
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this already a part of #21122?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@WillAyd

Yes...
I am not sure why that is in there.
I created separate branches for each of the changes I am proposing to:

  • delta
  • resolution
  • nanoseconds

etcetera, but the commit stream above seems to be sucking all of them into this PR.
super confused.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm this should just reflect what you have locally - any chance you merged your branches there accidentally?

Copy link
Contributor

Choose a reason for hiding this comment

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

when creating a new branch, do it off of upstream/master (or if you keep a local master then off of this). each branch should be independent.

you will need to revert the resolution part of this change (as its in the other PR). or can just close that one and do it here is ok too)

@@ -770,7 +799,48 @@ cdef class _Timedelta(timedelta):

@property
def resolution(self):
""" return a string representing the lowest resolution that we have """
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

when creating a new branch, do it off of upstream/master (or if you keep a local master then off of this). each branch should be independent.

you will need to revert the resolution part of this change (as its in the other PR). or can just close that one and do it here is ok too)

@chalmerlowe
Copy link
Contributor Author

i did some looking at how to git rid of (pun intended) a bunch of the changes that are cluttering up the works.
think I am gonna just close this, try to submit a new pull request starting with a clean slate.
See PR #21138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Timedelta Timedelta data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants