Skip to content

DOC: Fixing some doc warnings #26786

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 5 commits into from
Jun 12, 2019
Merged

DOC: Fixing some doc warnings #26786

merged 5 commits into from
Jun 12, 2019

Conversation

datapythonista
Copy link
Member

@datapythonista datapythonista commented Jun 11, 2019

Fixing some docs warnings, still many more, but will open few PRs with fixes, try to get a clean build and start failing the CI for doc warnings.

@codecov
Copy link

codecov bot commented Jun 11, 2019

Codecov Report

Merging #26786 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #26786      +/-   ##
==========================================
- Coverage   91.72%   91.72%   -0.01%     
==========================================
  Files         178      178              
  Lines       50779    50779              
==========================================
- Hits        46579    46575       -4     
- Misses       4200     4204       +4
Flag Coverage Δ
#multiple 90.31% <ø> (ø) ⬆️
#single 41.21% <ø> (-0.06%) ⬇️
Impacted Files Coverage Δ
pandas/core/arrays/datetimelike.py 97.93% <ø> (ø) ⬆️
pandas/core/generic.py 94.1% <ø> (ø) ⬆️
pandas/core/indexes/range.py 98.81% <ø> (ø) ⬆️
pandas/io/gbq.py 78.94% <0%> (-10.53%) ⬇️
pandas/core/frame.py 96.88% <0%> (-0.12%) ⬇️

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 ea06f8d...4320155. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 11, 2019

Codecov Report

Merging #26786 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #26786      +/-   ##
==========================================
- Coverage   91.73%   91.73%   -0.01%     
==========================================
  Files         178      178              
  Lines       50774    50774              
==========================================
- Hits        46578    46575       -3     
- Misses       4196     4199       +3
Flag Coverage Δ
#multiple 90.32% <100%> (ø) ⬆️
#single 41.21% <100%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/core/arrays/datetimelike.py 97.93% <ø> (ø) ⬆️
pandas/core/generic.py 94.1% <100%> (ø) ⬆️
pandas/io/gbq.py 78.94% <0%> (-10.53%) ⬇️
pandas/core/frame.py 96.88% <0%> (-0.12%) ⬇️
pandas/util/testing.py 90.94% <0%> (+0.1%) ⬆️

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 129aaea...5646735. Read the comment docs.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Overall change lgtm

@@ -10283,8 +10283,8 @@ def _doc_parms(cls):
Returns
-------
%(name1)s or %(name2)s (if level specified)\
%(see_also)s
%(examples)s\
%(see_also)s\
Copy link
Member

Choose a reason for hiding this comment

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

Do we have an expectation that substituted sections are responsible for line breaks? I feel like this has caused a few issues throughout code base curious if you have thoughts

Copy link
Member

Choose a reason for hiding this comment

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

@datapythonista I might already have fixed this one in https://github.com/pandas-dev/pandas/pull/26780/files, but by adding a extra newline in the "see also" string instead of here.
My reasoning was that if you do it here, and no see also is introduced, you might get too many empty lines (but didn't try that actually, so not sure this is correct)

Copy link
Member Author

Choose a reason for hiding this comment

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

This is trickier than what it looks, our validation complains if there are two line breaks together, and also a missing line break at the end. And we don't fail the validation, but we get warnings (and incorrect rendering) if the line break is missing before a section title, as the title is not detected.

It took me a while to find a working solution for all the cases, I think the one here is the only possible one, there are many docstrings affected by this.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I trust you here ;-) I only fixed that single case (of min/max I think), and didn't check the interaction with fixing others. But you might need to revert my change to get it working with master.

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 think the change you did was correct and is still needed, it just didn't address all the cases.

@WillAyd WillAyd added this to the 0.25.0 milestone Jun 11, 2019
@@ -10283,8 +10283,8 @@ def _doc_parms(cls):
Returns
-------
%(name1)s or %(name2)s (if level specified)\
%(see_also)s
%(examples)s\
%(see_also)s\
Copy link
Member

Choose a reason for hiding this comment

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

@datapythonista I might already have fixed this one in https://github.com/pandas-dev/pandas/pull/26780/files, but by adding a extra newline in the "see also" string instead of here.
My reasoning was that if you do it here, and no see also is introduced, you might get too many empty lines (but didn't try that actually, so not sure this is correct)

@@ -396,7 +396,7 @@ IntervalIndex

pandas has gained an ``IntervalIndex`` with its own dtype, ``interval`` as well as the ``Interval`` scalar type. These allow first-class support for interval
notation, specifically as a return type for the categories in :func:`cut` and :func:`qcut`. The ``IntervalIndex`` allows some unique indexing, see the
:ref:`docs <indexing.intervallindex>`. (:issue:`7640`, :issue:`8625`)
:ref:`docs <api.intervalindex>`. (:issue:`7640`, :issue:`8625`)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
:ref:`docs <api.intervalindex>`. (:issue:`7640`, :issue:`8625`)
:ref:`docs <advanced.intervalindex>`. (:issue:`7640`, :issue:`8625`)

I think the original intent was to refer to the user guide section, which is moved to "advanced.rst" (we actually shouldn't have renamed that label in the first place ..)

----------
start
stop
step
Copy link
Member

Choose a reason for hiding this comment

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

why remove those?

Copy link
Member Author

Choose a reason for hiding this comment

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

those are not actual attributes for what I saw, I'll revert here anyway, and let's take care of RangeIndex in a separate PR

Copy link
Member

Choose a reason for hiding this comment

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

They recently got added as actual attributes, IIRC

Copy link
Member Author

Choose a reason for hiding this comment

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

you're right, I think I didn't test in master

@@ -493,3 +493,18 @@ Methods
PeriodIndex.asfreq
PeriodIndex.strftime
PeriodIndex.to_timestamp

RangeIndex
----------
Copy link
Member

Choose a reason for hiding this comment

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

Looking more closely at the log output and our current docs -> RangeIndex is actually already included in the API docs in the "Numeric Index" above (I think it makes sense to have it in the numeric section)

But the question is then: why did we get those warnings in the current doc build on master. It might be that we need to add the attributes here as well (not fully sure)

@datapythonista
Copy link
Member Author

@jorisvandenbossche addressed comments, I think this one should be ready.

Are you working on other doc warnings?

@jorisvandenbossche
Copy link
Member

Are you working on other doc warnings?

Not at the moment

@jorisvandenbossche
Copy link
Member

Down to 147 warnings :)

@jorisvandenbossche jorisvandenbossche merged commit b72a4ff into pandas-dev:master Jun 12, 2019
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.

3 participants