You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mangle_docstring is called on already-processed docstrings #134
It seems that due to wrap_mangling_directives, even in our simple example code, we're visiting the same docstring multiple times, and running our mangling over an already-mangled docstring. This is creating especial rubbish with reference renaming, but we've certainly not tested the effect of this on any of our docscrape apparatus either!
With the current example.py and docs, we get calls to mangle_docstrings with:
The second processing of the foobar method appears to be harmless: it's called in processing the .. autosummary we include in the class docstring, when summarising the method dosctring. The third appears to be a bug in sphinx, and I will raise an issue there and reference ours.
The remaining unnecessary and harmful (double-processing) calls are due to wrap_mangling_directives, whose purpose I've not yet fathomed.
Some tracing tells me that wrap_mangling_directives results in NumpyPythonDomain's directives being used to handle py:class, py:function, etc. Is that the intention, @pv?
Do these domains remain relevant? I can't see any reference to them in the numpy or scipy repositories currently. I see that you commented on their likely irrelevance in 2012.
Can we drop them without deprecation if they're unlikely used and causing weird behaviour (and duplicated work)??
Activity
jnothman commentedon Oct 26, 2017
Here there seem to be four manglings of the
Foobar.foobardocstring, one of them operating over the pre-mangled docstring.jnothman commentedon Oct 26, 2017
This is not all due to
wrap_mangling_directives, it seems. If I drop it, I'm still left with some duplicates:jnothman commentedon Oct 30, 2017
The second processing of the foobar method appears to be harmless: it's called in processing the
.. autosummarywe include in the class docstring, when summarising the method dosctring. The third appears to be a bug in sphinx, and I will raise an issue there and reference ours.The remaining unnecessary and harmful (double-processing) calls are due to
wrap_mangling_directives, whose purpose I've not yet fathomed.jnothman commentedon Oct 31, 2017
Some tracing tells me that
wrap_mangling_directivesresults inNumpyPythonDomain's directives being used to handlepy:class,py:function, etc. Is that the intention, @pv?Do these domains remain relevant? I can't see any reference to them in the numpy or scipy repositories currently. I see that you commented on their likely irrelevance in 2012.
Can we drop them without deprecation if they're unlikely used and causing weird behaviour (and duplicated work)??
jnothman commentedon Nov 1, 2017
@astrofrog fwiw, merging #135 might also give multiplicative speedups if lots of time was spent in numpydoc
jnothman commentedon Nov 1, 2017
Fixed in #135