Skip to content

DOC: Fixing some more warnings #26810

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 4 commits into from
Jun 14, 2019
Merged

DOC: Fixing some more warnings #26810

merged 4 commits into from
Jun 14, 2019

Conversation

datapythonista
Copy link
Member

Fixing some more warnings in the doc build, and small improvements to the interpolation doc.

CC: @jorisvandenbossche

@jorisvandenbossche
Copy link
Member

BTW, the issue for the problem with the IPython directive is here: ipython/ipython#11362

@datapythonista
Copy link
Member Author

@jorisvandenbossche any idea why I'm getting a lot of those locally:

.. autoproperty:: categories
/home/mgarcia/src/pandas/doc/source/reference/api/pandas.Categorical.codes.rst:6: WARNING: Unknown directive type "autoproperty".

I think it started after downgrading sphinx back to 1.8.5

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Added some comments!

@@ -713,6 +713,9 @@ See the :ref:`Plotting <visualization>` docs.

.. ipython:: python

# register converters to display dates in plots
pd.plotting.register_matplotlib_converters()
Copy link
Member

Choose a reason for hiding this comment

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

This should not be added, the warning in the log is indicating a recent regression, see #26770

@@ -4703,6 +4703,7 @@ See the documentation for `pyarrow <https://arrow.apache.org/docs/python/>`__ an
Write to a parquet file.

.. ipython:: python
:okwarning:
Copy link
Member

Choose a reason for hiding this comment

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

yeah, this is fine.

Although, we should actually make sure to install the latest version of pyarrow (where this is fixed), but for some reason conda installs 0.11 instead of 0.13

ts[60:80] = np.nan
ts = ts.cumsum()

.. ipython:: python

ts
ts.count()
@savefig series_before_interpolate.png
ts.interpolate().plot()
Copy link
Member

Choose a reason for hiding this comment

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

should this be without the interpolate? As the above line is already included a couple of lines below

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch, I saw it when reviewing the rendered page, and thought I fixed it, but seems like I didn't

@@ -455,7 +462,7 @@ at the new values.
ser = pd.Series(np.sort(np.random.uniform(size=100)))

# interpolate at new_index
new_index = ser.index | pd.Index([49.25, 49.5, 49.75, 50.25, 50.5, 50.75])
new_index = pd.Float64Index(ser.index | pd.Index([49.25, 49.5, 49.75, 50.25, 50.5, 50.75]))
Copy link
Member

Choose a reason for hiding this comment

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

I would leave this change out.

Yes, it is annoying that it fails, but this should work and is a regression we need to fix (and we actually catched this due to the docs).

If this is the final error that is remaining and blocking that we can start failing CI for errors/warnings in the docs, then we can do that or add a temporary :okexcept:, but we are not there yet I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

adding an :okexcept:, I'm trying to make this the last time in my life I fix lots of pandas doc warnings (it's not the first), so hopefully we can add the check soon

@jorisvandenbossche
Copy link
Member

any idea why I'm getting a lot of those locally:

Not sure, I also don't see those on the PR pinning to 1.8.5

@jorisvandenbossche
Copy link
Member

any idea why I'm getting a lot of those locally:

did you do a full clean build? It might be that the api rst pages generated by sphinx 2 are not compatible with 1.8.5 ?

@codecov
Copy link

codecov bot commented Jun 12, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #26810      +/-   ##
==========================================
- Coverage   91.76%   91.75%   -0.01%     
==========================================
  Files         178      178              
  Lines       50751    50751              
==========================================
- Hits        46574    46569       -5     
- Misses       4177     4182       +5
Flag Coverage Δ
#multiple 90.35% <ø> (ø) ⬆️
#single 41.2% <ø> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 78.94% <0%> (-10.53%) ⬇️
pandas/core/frame.py 96.88% <0%> (-0.12%) ⬇️
pandas/util/testing.py 90.84% <0%> (-0.11%) ⬇️

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 8ff488a...3d43234. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 12, 2019

Codecov Report

Merging #26810 into master will increase coverage by 1.4%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #26810     +/-   ##
=========================================
+ Coverage   90.45%   91.86%   +1.4%     
=========================================
  Files         179      179             
  Lines       50706    50706             
=========================================
+ Hits        45866    46579    +713     
+ Misses       4840     4127    -713
Flag Coverage Δ
#multiple 90.45% <ø> (ø) ⬆️
#single 41.09% <ø> (?)
Impacted Files Coverage Δ
pandas/util/testing.py 90.94% <0%> (+0.1%) ⬆️
pandas/core/arrays/categorical.py 95.92% <0%> (+0.12%) ⬆️
pandas/core/indexes/datetimes.py 96.37% <0%> (+0.16%) ⬆️
pandas/io/formats/printing.py 85.56% <0%> (+1.06%) ⬆️
pandas/io/clipboard/clipboards.py 34.78% <0%> (+2.89%) ⬆️
pandas/core/computation/expr.py 97.8% <0%> (+3.02%) ⬆️
pandas/core/computation/common.py 89.47% <0%> (+5.26%) ⬆️
pandas/io/pytables.py 90.29% <0%> (+26.47%) ⬆️
pandas/core/computation/pytables.py 90.24% <0%> (+27.74%) ⬆️

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 e8132a2...bd5afaa. Read the comment docs.

@datapythonista
Copy link
Member Author

@jorisvandenbossche this should be ready, after this there aren't many warnings left. Some tricky ones but we're not that far.

I see many of this type:

2019-06-13T09:16:31.8908721Z /home/vsts/work/1/s/doc/source/reference/api/pandas.arrays.DatetimeArray.map.rst: WARNING: document isn't included in any toctree
2019-06-13T09:16:31.8910069Z /home/vsts/work/1/s/doc/source/reference/api/pandas.arrays.DatetimeArray.ndim.rst: WARNING: document isn't included in any toctree
2019-06-13T09:16:31.8911939Z /home/vsts/work/1/s/doc/source/reference/api/pandas.arrays.IntegerArray.dtype.rst: WARNING: document isn't included in any toctree
2019-06-13T09:16:31.8913217Z /home/vsts/work/1/s/doc/source/reference/api/pandas.arrays.IntervalArray.argsort.rst: WARNING: document isn't included in any toctree
2019-06-13T09:16:31.8914672Z /home/vsts/work/1/s/doc/source/reference/api/pandas.arrays.IntervalArray.astype.rst: WARNING: document isn't included in any toctree

Checking the first one, I see in http://dev.pandas.io/reference/api/pandas.arrays.DatetimeArray.html that map is indeed not included in the toctree. But in the docstring I see that the attributes and methods are actually not explicit, but added automatically: https://github.com/pandas-dev/pandas/blob/master/pandas/core/arrays/datetimes.py#L214

Any idea what's the problem/how to fix those? Thanks!

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Jun 13, 2019

@datapythonista DatetimeArray.map's doesn't have a docstring, and it may not inherit one. Can you see if adding a simple docstring fixes that warning?

edit: IntegerArray.dtype also doesn't have a docstring.

@TomAugspurger
Copy link
Contributor

For IntervalArray.{argsort,astype}, I think they will need to be added to the list of methods in the class docstring.

@jorisvandenbossche
Copy link
Member

For IntervalArray.{argsort,astype}, I think they will need to be added to the list of methods in the class docstring.

Or not? (because I don't think we want them in the API reference for each array?)

@TomAugspurger
Copy link
Contributor

Hmm, right I was thinking about it backwards (thinking we had a ref, but no target). I wonder why it's being generated then.

@jorisvandenbossche
Copy link
Member

Looking at the code, I think we should take the "class_without_autosummary" template approach for all our internal EAs as well (which we currently don't do apparently, except for Categorical). Trying that out now.

@jorisvandenbossche
Copy link
Member

See #26834

@jorisvandenbossche
Copy link
Member

Looks good to me. Can you open an issue about the changes here that should be reverted once the cause is fixed? (the added okwarning/okexcepts)

@jorisvandenbossche jorisvandenbossche merged commit 8374a1d into pandas-dev:master Jun 14, 2019
@jorisvandenbossche
Copy link
Member

Opened an issue for those okwarning/okexcepts: #26843

@jorisvandenbossche jorisvandenbossche added this to the 0.25.0 milestone Jun 14, 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.

DOC: Fix doc warning "Code input with no code"
3 participants