-
-
Notifications
You must be signed in to change notification settings - Fork 165
BUG: Reference de-duplication isn't parallel-safe #112
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 is correct: numpydoc reference renumbering is not parallel safe. |
Should we consider making the reference renumbering a separate extension, marked unsafe? It would seem to me to be completely separate from the rest of numpydoc. |
IIRC the numpydoc citation format is not RST citation but RST footnotes,
so not so clear all mangling can be removed.
|
At the cost of some nastier looking reference names, we could hash the reference text itself to generate the link IDs. |
(This should solve the parallel problem;) |
ideally we wouldn't change the displayed reference names at all, but
generate unique IDs for linking. I wonder if there's some way to do that.
|
We can probably just generate internal links? |
I.e. work around the reST citation mechanism? I suppose we could. |
It would be hard to get citation formatting matching the default in both web and PDF using |
(I.e. in PDF the bibliography appears as an endnote) |
I think this could be acceptable. If the same hash appears multiple times in a doc, the first will be the link target, but maybe we can live with this. Alternatively, we can use numbered refs prefixed by the docstring object name. There seem to be a number of issues with reference mangling. It appears to be untested. It should be possible to disable, and perhaps should be an extension of its own with I'm inclined to one of the parallel-safe solutions above, but perhaps still making the mangling possible to disable... |
Alternatives for solving this:
Opinions? |
I don't like (1) and (2) much. Anything that makes the references appear in text as garble seem less than ideal. I'm OK with (6), since we mostly generate HTML, but I suspect we'll get strong resistance. Does option (3) or (4) allow for reasonable looking links backed by hashes? |
I'm not sure what "backed by hashes" means. I'll try to throw together some implementations and screenshots I suppose |
I just mean the links can point to anything, they don't need to be legible URIs, but the text that appears on the page should be reasonable. |
I don't think that's possible with reST's citation rendering, so that requires (6). |
From a pragmatic point, is avoiding (1) a big issue? |
There may be a way to do this with a read-doctree hook. Firstly we need a way to mark where numpydoc's processing begins and ends. Fortunately comments are accessible in the doctree, but we can't just bookend the mangled docstring with comments because the beginning of the docstring is processed naively by autosummary to produce a snippet... :\ |
@pv Good question. Do we rely on users to set parallel processing to false, or can we control that from within the extension? |
We currently emit metadata in setup that says numpydoc is
parallel_read_safe.
…On 1 November 2017 at 10:55, Stefan van der Walt ***@***.***> wrote:
@pv <https://github.com/pv> Good question. Do we rely on users to set
parallel processing to false, or can we control that from within the
extension?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#112 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEz6-0nqXUV4CBf30mNOv89Uq820Qvhks5sx7NUgaJpZM4PpmtG>
.
|
From my experiments with astropy, using parallel mode can speed things up by a factor of 2 or more in some cases (saving minutes of build time) so definitely worth it as a developer who wants to check what updated docs look like. It would be a shame to lose that just because of reference de-duplication. So if you wanted to go down the road of 'won't fix', at least please consider making it possible to disable de-duplication as a numpydoc option and then return 'True' for |
I have a fix for this in #136 |
Currently Numpydoc is marked as a parallel-safe sphinx plugin, but the renaming of duplicate references in
rename_references
is not parallel-safe becausereference_offset
will be [0] in each process at the start of the function call.I'm running into conflicts when building the Astropy docs:
The text was updated successfully, but these errors were encountered: