Closed amueller closed 8 years ago
Indeed, this is terrible...
Could you give me small example project to reproduce it? The docs of scikit-learn is too complicated to reproduce the problem to me...
I'll try to come up with something. It's basically anytime you use autodoc. You could use my wordcloud project which is much smaller but I'll come up with a minimal example. I think the issues is how the autodoc document / parsing structure works. I've been using sphinx for a while but I'm new to the code. It looks like the node that has the error has no reference to the python file it came from.
Sent from phone. Please excuse spelling and brevity.
On Sep 7, 2016 12:42 AM, "Takeshi KOMIYA" notifications@github.com wrote:
Indeed, this is terrible...
Could you give me small example project to reproduce it? The docs of scikit-learn is too complicated to reproduce the problem to me...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sphinx-doc/sphinx/issues/2940#issuecomment-245173548, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbcFo7PQmj8o-TwW0zda9CY_k4l9ubDks5qnkDEgaJpZM4J2VqG .
I tried to create a minimal example here, and what I'm getting is
/home/andy/checkout/sphinx_autodoc_debug/main.py:docstring of main.my_function:17: ERROR: Unknown target name: "reference".
Which is much nicer. I'll go and try to reproduce what happens with sklearn. What would be even nicer than what is in this example is to have the line in the python file.
I could reproduce with a minimal example. Seems numpydoc is the problem. Still any help would be much appreciated.
I think the problem is here: https://github.com/numpy/numpydoc/blob/master/numpydoc/numpydoc.py#L202
But I have no idea how to fix it :(
Turns out the problem was in numpydoc.
At scikit-learn we've been struggling a lot with finding and fixing errors in the sphinx built. We're using automethod, autoclass and automodule with numpydoc. A problem we keep running into is that autoclass and automodule don't provide absolute line number or even files for where the error is. Instead, they provide the full docstring of that class or method, together with a line number in that docstring. That means that each error generates an error message about one computer screen long, such as
which makes it really hard for us to find and fix the issue. It would be great to get an error that points to the original file where that source came from, and to the line.
Any help would be much appreciated. I'm more than happy to chip in if anyone can tell me how to achieve that.