Skip to content

Unnecessary renaming of references #114

Closed

Description

@astrofrog

Numpydoc now renames references even when this is not needed. For example, a reference originally called Scargle2012 has now been renamed in the Astropy docs:

screen shot 2017-10-10 at 22 49 07

Is this intentional? Should we be using only numerical reference names? Or is it a bug since there are no duplicates of this reference so no reason to rename it?

Activity

  1. stefanv commented on Oct 10, 2017

    @stefanv
    Contributor

    This is not necessary. The initial de-duplication script used numerical references for simplicity, but there's no reason why that has to be the case.

  2. astrofrog commented on Oct 10, 2017

    @astrofrog
    Author

    @stefanv - ok, thanks! Just to be clear, in this case this may actually be a regression since in the rest of the docstring the reference is referred to by Scargle2012_ and those references were not updated, so now give warnings when building the docs.

  3. stefanv commented on Oct 10, 2017

    @stefanv
    Contributor

    I just read the code, and it does special case for anything other than numeric references. I guess it will transform it to something like Scargle20120. What warning do you see?

  4. astrofrog commented on Oct 11, 2017

    @astrofrog
    Author

    Basically I think it doesn't rename the Scargle2012_ reference in the text of the docstring so I saw an 'undefined reference' warning. Note that in the interest of time I just changed that reference to a numerical one, so this is not an issue for me anymore.

  5. jnothman commented on Oct 22, 2017

    @jnothman
    Member

    @astrofrom shouldn't you be referring to it by [Scargle2012]_ rather than Scargle2012_?

    Still, there's no way to determine if there will be a duplicate and also mangle the references in a single pass over the docstrings. We could allow the first appearance of a reference to not be mangled, if there is little risk in tracking all references ever mentioned. We could also insert some delimiter between the existing reference and the added number in the non-numeric case.

  6. jnothman commented on Oct 26, 2017

    @jnothman
    Member

    ok, thanks! Just to be clear, in this case this may actually be a regression since in the rest of the docstring the reference is referred to by Scargle2012_ and those references were not updated, so now give warnings when building the docs.

    The mangling here should only affect those references that are listed with .. [xxx] in the docstring...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions