-
-
Notifications
You must be signed in to change notification settings - Fork 165
References messed up #177
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
hmm. i can't investigate now but I'd be looking at interaction with other
sphinx plugins, perhaps also sphinx and docutils version but I suspect
that's not the issue.
|
I created a minimal example, called
Creating the docs with In this minimum example I only use the extensions I add here this working minimal example for testing purposes: |
I found the source of the problem. Well, kind of. In the above minimal example, if I change
to
then all is fine. Similarly, I change in my project from
to
and now everything is smooth and beautiful. Any idea why this could be? |
numpydoc is not napoleon, so let's keep this open for here. |
Ok, it is probably good to get to the bottom of it. I thought an issue could have been that I used Indeed; it fixed the citation issue, but because I removed |
The numpydoctest example seems to fail in the reference mangling due to two issues we'd not considered:
<document source="/Users/joel/repos/numpydoc/numpydoctest/manual.rst">
<target ids="['module-numpydoctest']" ismod="True" />
<index entries="[('single', 'numpydoctest (module)', 'module-numpydoctest', '', None)]" />
<paragraph>
<pending_xref ids="id1" refdomain="std"
reftarget="R8432db73336c-Name_Year" reftype="citation"
refwarn="True">[R8432db73336c-Name_Year]</pending_xref>
</paragraph>
<paragraph>
<pending_xref ids="id2" refdomain="std"
reftarget="R8432db73336c-Test_2018" reftype="citation"
refwarn="True">[R8432db73336c-Test_2018]</pending_xref>
</paragraph>
<section ids="references" names="references">
<title>References</title>
<citation backrefs="id1" ids="r8432db73336c-name-year"
names="r8432db73336c-name_year">
<label>R8432db73336c-Name_Year</label>
<paragraph>Name, Year, This is a test publication: The
Journal.</paragraph>
</citation>
<citation backrefs="id2" ids="r8432db73336c-test-2018"
names="r8432db73336c-test_2018">
<label>R8432db73336c-Test_2018</label>
<paragraph>Test, 2018, A follow up: The Other
Journal.</paragraph>
</citation>
<comment xml:space="preserve">
!! processed by numpydoc !!
</comment>
</section>
</document> |
We could probably determine whether we're in a numpydoc docstring by exploiting that "!! processed by numpydoc !!" comment. I might get around to submitting a PR. Alternatively, maybe we're wrong to be renaming references in modules at all...??? |
My claim above about doctree-read depending on -d seems to have been incorrect. |
…mpydoc docstring Fixes numpy#177
Just tested it and it works fine for me, thanks! |
I have seen a similar problem for docstrings but only for docstrings outside of functions. I have attached an example which is heavy inspired by prisaes, and by running the same line If I delete ´:members:´ from manual.rst the docstring outside the function works as expected. Am i doing anything wrong? I'm running the newest version (0.9.1). |
Which version are you using? For me all problems are resolved from numpydoc version 0.9.0 onwards. |
I'm using version numpydoc 0.9.1 and python 3.7.3. My attached example is not completely the same as your example. |
Doesn't work for me either. I suggest you open a new issue, as this issue here was resolved. I don't now what is going in your case, I am sorry. |
What do you get with numpydoc |
Version 0.8.0 of numpydoc supposedly fixed the referencing issue, but in my case it got worse, and I wonder why (related to #114).
With

numpydoc v0.6.0
I get the following:So for instance [Key_2012]: author_year, exactly what I intended to do.
With

numpydoc v0.7.0
I get the following:So it added a '0' to each reference.
But now with

numpydoc v0.8.0
I get the following:I assume that is not as was intended with the bugfix in #136?
Should I change the way I use references, or is this a bug that persists in numpydoc?
I have in readthedocs numpydoc fixed to 0.6.0, but if it helps the complete manual is here: http://empymod.readthedocs.io
Details regarding the build using conda (and pip for sphinxcontrib-napoleon) with Python 3.6:
numpydoc v0.8.0
andnumpydoc v0.7.0
:sphinx 1.7.4; sphinxcontrib 1.0; sphinxcontrib-napoleon 0.6.1.
numpydoc v0.6.0
sphinx 1.6.6; sphinxcontrib 1.0; sphinxcontrib-napoleon 0.6.1.
The text was updated successfully, but these errors were encountered: