-
-
Notifications
You must be signed in to change notification settings - Fork 166
Parsing See Also became too picky #206
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
Comments
This must be gh-172. It explicitly enumerates the valid |
It used a sentence rather than an object to cross-reference. numpydoc grew more picky (see numpy/numpydoc#206), so cleaning this up. It was already not rendering correctly in html.
I think we can try to be backwards compatible here. If there's no colon, that's hopefully a good heuristic. |
I think disallowing this is fine, the generated html was wrong before anyway: https://www.numpy.org/devdocs/reference/generated/numpy.generic.diagonal.html#numpy.generic.diagonal The more annoying bit was that commas at the end of a list of function names now generates warnings. Here is what I needed to fix in numpy: numpy/numpy#13331. Arguably the comma at the end of the first line here is okay:
|
Sounds like we need a few more test cases. @pvanmulbregt
|
I added the warning for the trailing comma in response to a reviewer's comments, but if the example above in #206 (comment) is acceptable, then the warning should be removed. Perhaps before adding more tests cases, the spec could be nailed down? As noted in #172 (comment) backticks require a role, and any function name with |
I also had this issue (the original reported, not the comma's) when testing the pandas docs with numpydoc master. I first wanted to open an issue here, but it turned out to be all templating mistakes in the pandas docs, so I am also OK with keep disallowing this and not trying to be backwards compatible (in the end, it catched errors in our docs) |
A docstring containing the text "See also the corresponding attribute" is failing. Could the error message at least indicate which object's docstring is being parsed? The error message below is not very helpful
```
File ".../numpy/doc/sphinxext/numpydoc/docscrape.py", line 330, in _parse_see_also
raise ParseError("%s is not a item name" % line)
numpydoc.docscrape.ParseError: The corresponding attribute ... .\n\nSee Also\n--------\nThe corresponding attribute ...'
Exception occurred:
|
@mattip I already commented on numpy/numpy#13331 (comment). See the
Yes this would be very useful. It's often really hard to do though, I think it's Sphinx' single worst issue - the whole debugging experience is awful. |
That was me :) Comma before colon seems a problem. Finishing the line with a comma is okay without colon (and ideally if the next line is not indented etc.). |
yes same here, +1 for being strict
yes, we can more completely enumerate the allowed cases and add them to https://numpydoc.readthedocs.io/en/latest/format.html#sections |
After going through all of numpy and some of scipy, I didn't find any other types of cases. So for the spec I would propose:
Anyone else have other cases? |
Not that I've seen, I also just hit the trailing comma case. |
This was fixed by gh-207, closing |
NumPy has a whole bunch of these in
numpy/core/_add_newdocs.py
, and with current master that crashes the doc build (0.8.0 works fine).The text was updated successfully, but these errors were encountered: