Skip to content

DOC: fix PR09,PR08 doc string errors in Timestamp, NaT, Timedelta class #28674

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 24 commits into from

Conversation

josibake
Copy link

@josibake josibake commented Sep 29, 2019

This fixes PR09,PR08 errors in Timestamp, NaT, Timedelta classes

Example:

pandas.Timestamp.ceil: Parameter "ambiguous" description should finish with "."
pandas.Timestamp.ceil: Parameter "nonexistent" description should finish with "."
pandas.Timestamp.day_name: Parameter "locale" description should finish with "."
pandas.Timestamp.floor: Parameter "ambiguous" description should finish with "."
pandas.Timestamp.floor: Parameter "nonexistent" description should finish with "."
pandas.Timestamp.fromordinal: Parameter "ordinal" description should finish with "."
pandas.Timestamp.fromordinal: Parameter "freq" description should finish with "."
pandas.Timestamp.month_name: Parameter "locale" description should finish with "."
pandas.Timestamp.now: Parameter "tz" description should finish with "."
pandas.Timestamp.round: Parameter "ambiguous" description should finish with "."
pandas.Timestamp.round: Parameter "nonexistent" description should finish with "."
pandas.Timestamp.today: Parameter "tz" description should finish with "."
pandas.Timestamp.tz_localize: Parameter "ambiguous" description should finish with "."
pandas.Timestamp.tz_localize: Parameter "nonexistent" description should finish with "."
pandas.Timestamp.tz_localize: Parameter "errors" description should finish with "."

closes #28673

  • closes #xxxx
  • tests added / passed

This fixes Parameter {} description should finish with "."
in the Timestamp class

closes pandas-dev#28673
@simonjayhawkins simonjayhawkins added this to the 1.0 milestone Sep 29, 2019
@josibake
Copy link
Author

looks like the tests are failing due to:

compare = (<class 'pandas._libs.tslibs.timestamps.Timestamp'>, 'ceil')

    @pytest.mark.parametrize(
        "compare",
        (
            _get_overlap_public_nat_methods(Timestamp, True)
            + _get_overlap_public_nat_methods(Timedelta, True)
        ),
    )
    def test_nat_doc_strings(compare):
        # see gh-17327
        #
        # The docstrings for overlapping methods should match.
        klass, method = compare
        klass_doc = getattr(klass, method).__doc__

which i am assuming means i will also need to edit the Timedelta class

@josibake josibake changed the title DOC: fix PR09 doc string errors in Timestamp class DOC: fix PR09 doc string errors in Timestamp, NaT, Timedelta class Sep 29, 2019
@josibake
Copy link
Author

adding NaT, Timedelta class since it looks like I'll have to fix those too to get it to past the tests

Josiah Baker added 2 commits September 29, 2019 19:10
docstrings for Timestamp, NaT and Timedelta classes must match
for overlapping methods. verified they now pass the test_nat.py test
@josibake
Copy link
Author

josibake commented Sep 29, 2019

confirmed that this fixes PR09 for Timedelta,Timestamp,NaT classes:

./scripts/validate_docstrings.py --errors=PR09,PR08 | grep -E "Timedelta\.|Timestamp\.|NaT\."

@josibake josibake changed the title DOC: fix PR09 doc string errors in Timestamp, NaT, Timedelta class DOC: fix PR09,PR08 doc string errors in Timestamp, NaT, Timedelta class Sep 30, 2019
@josibake
Copy link
Author

this is related to #27977 and #28602 (adding for visibility)

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.

Thanks for working on this, great PR. Added few minor comments, but looks good.

Josiah Baker added 5 commits September 30, 2019 20:27
This fixes Parameter {} description should finish with "."
in the Timestamp class

closes pandas-dev#28673
docstrings for Timestamp, NaT and Timedelta classes must match
for overlapping methods. verified they now pass the test_nat.py test
change ambiguous parameter to be more readable
remove the period after versionadd
@josibake
Copy link
Author

josibake commented Oct 1, 2019

sorry about re-adding all the commits @datapythonista ; something was screwed up with how I had my local branch set up. should be fixed now.

jbrockmendel and others added 2 commits October 1, 2019 00:08
missed a few periods from the last commit
also incorrectly moved a sphinx directive earlier
@josibake josibake requested a review from WillAyd October 1, 2019 05:23
lag_indexer = tuple(lag_indexer)
# To keep mypy happy, _res_indexer is a list while res_indexer is
# a tuple, ditto for lag_indexer.
_res_indexer = [slice(None)] * arr.ndim
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is supposed to be part of your PR. Are you sure you merged in the latest changes from upstream/master?

@josibake
Copy link
Author

josibake commented Oct 1, 2019

apologies, i am a little confused on this one and cant figure out what im doing wrong. I ran:

git checkout PR09-Timestamp-fix
git fetch upstream
git merge upstream/master

but this adds more commits into the PR. let me read up on github docs and figure out what im doing and then ill take a another stab at opening a PR

@josibake josibake closed this Oct 1, 2019
@josibake josibake deleted the PR09-Timestamp-fix branch October 3, 2019 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOCS: fix PR09,PR09 doc string errors in Timestamp, NaT, Timedelta class