Skip to content
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

DOC: update vendored numpydoc version #20383

Conversation

jorisvandenbossche
Copy link
Member

@jorisvandenbossche jorisvandenbossche commented Mar 16, 2018

The first commit only updates our vendored version with the upstream one.

Additional commits make it work with our docs:

  • edit numpydoc to allow member listing for attributes (this is a change (and the only) to the source code of numpydoc that is not upstream: discussed in Format attributes like parameters numpy/numpydoc#106)
  • numpydoc settings: use numpydoc_use_blockquotes=False for now for compatibility (it is deprecated). To fix this, we need to fix: css styling of description lists + warnings generated due to **kwargs

It is probably worth to look at the separate commits (and would also like to keep them when merging)

@pep8speaks
Copy link

pep8speaks commented Mar 16, 2018

Hello @jorisvandenbossche! Thanks for updating the PR.

Line 567:21: E126 continuation line over-indented for hanging indent

Line 36:80: E501 line too long (84 > 79 characters)
Line 39:80: E501 line too long (82 > 79 characters)
Line 355:25: E241 multiple spaces after ':'

Line 458:1: E128 continuation line under-indented for visual indent
Line 595:1: E128 continuation line under-indented for visual indent
Line 731:5: E122 continuation line missing indentation or outdented
Line 741:80: E501 line too long (124 > 79 characters)
Line 1184:80: E501 line too long (94 > 79 characters)
Line 1186:5: E128 continuation line under-indented for visual indent

Comment last updated on March 27, 2018 at 14:57 Hours UTC

@@ -33,6 +33,7 @@ def load_config(self, config):
self.use_plots = config.get('use_plots', False)
self.use_blockquotes = config.get('use_blockquotes', False)
self.class_members_toctree = config.get('class_members_toctree', True)
self.attributes_as_param_list = config.get('attributes_as_param_list', True)
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this ensure that Attributes is formatted like a table?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes (updated the top post). For now, that is the only change I made to the numpydoc source (it's in a separate commit).

But, if I am the only one that finds that better, I am OK to leave that.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, I prefer the attributes table. I just didn't realize there was an option for it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, there isn't ;-) That's something I added here (but with only a few lines: 075438f), and that's what I proposed to do in numpy/numpydoc#106, so it would be nice to have this in upstream)

@jorisvandenbossche
Copy link
Member Author

We still have the problem we fixed with this hack: 70c9d31, related to the property's that are None.

However, due to recent work, I think only .index and .columns are left for this (there are others there as well that don't show up properly, but that is because of the if pydoc.getdoc(param_obj) check and they have no docstring .. so that is easily fixable).

@jorisvandenbossche
Copy link
Member Author

.index and .columns should be fixed with #20385

@pandas-dev pandas-dev deleted a comment Mar 16, 2018
@codecov
Copy link

codecov bot commented Mar 17, 2018

Codecov Report

Merging #20383 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #20383      +/-   ##
==========================================
- Coverage   91.85%   91.82%   -0.03%     
==========================================
  Files         152      152              
  Lines       49233    49233              
==========================================
- Hits        45222    45210      -12     
- Misses       4011     4023      +12
Flag Coverage Δ
#multiple 90.21% <ø> (-0.03%) ⬇️
#single 41.88% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/plotting/_converter.py 65.07% <0%> (-1.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 89444ad...41bbc7b. Read the comment docs.

@jorisvandenbossche jorisvandenbossche force-pushed the doc-update-vendored-numpydoc branch 2 times, most recently from efab591 to faba146 Compare March 26, 2018 12:51
@jorisvandenbossche
Copy link
Member Author

Updated this.

The remaining related warnings I think are:

/tmp/doc/source/generated/pandas.Index.holds_integer.rst: WARNING: document isn't included in any toctree
/tmp/doc/source/generated/pandas.Index.is_type_compatible.rst: WARNING: document isn't included in any toctree
/tmp/doc/source/generated/pandas.Series.imag.rst: WARNING: document isn't included in any toctree
/tmp/doc/source/generated/pandas.Series.real.rst: WARNING: document isn't included in any toctree

this seems to be because they are not listed manually in api.rst, and are also not linked in the class docstring page (because they have no docstring they appear as plain table entry, not link to the docstring page. With as a result there is nowhere a link to that page).

@TomAugspurger
Copy link
Contributor

Would adding them to the hidden toctree at the bottom of api.rst be OK? It'd fix the warnings. Not sure what happens to the links...

@jorisvandenbossche
Copy link
Member Author

Would adding them to the hidden toctree at the bottom of api.rst be OK? It'd fix the warnings. Not sure what happens to the links...

So now I need to remember again why we had those entries there at the bottom of api.rst ... Which you added in #18202. Because this are attributes that were not yet included in api.rst before, and it is only now because they were no longer included in their class docstring page, there was a warning.
But actually just giving them a proper docstring, should put them back in their class docstring page, and so fix the warning. So that is the more proper fix I think.

Numpydoc upstream at 21a194e9b42ebe95a70475e35cb69bcb4801ff36
…riptor to check attributes

This is needed to ensure .columns / .index / cached properties are recognized as an attribute
@jorisvandenbossche
Copy link
Member Author

OK, so it seems that as long as they are properly included in the class docstring page toctree, that is also fine, so in principle then we can get rid of the full list of hidden items in api.rst (but for that, we need to add docstrings to some of those methods). That's the proper fix for the warnings, but will leave that for another PR (now added them to the hidden list in api.rst)

@jorisvandenbossche
Copy link
Member Author

Travis doc build looks good

@jorisvandenbossche jorisvandenbossche merged commit 7fd3b85 into pandas-dev:master Mar 27, 2018
@jorisvandenbossche jorisvandenbossche deleted the doc-update-vendored-numpydoc branch March 27, 2018 19:45
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