Skip to content

add call outs to all references in docstrings #837

Closed

Description

@wholmgren

#833 converts all references into the numpydoc format. The unfortunate side effect of this is that it creates a lot of warnings in the sphinx build because many of the references are not called out in the docstring. #833 silences these warnings using suppress_warnings = ['ref.footnote']. In the long run, it would be great to call out the references and remove the suppress warnings statement. That would move us one step closer to automatically and comprehensively checking docstrings for style.

Activity

  1. added this to the 0.8.0 milestone on Dec 13, 2019
  2. souravsingh commented on Jan 7, 2020

    @souravsingh

    @wholmgren I am interested in taking a stab at the issue.

  3. wholmgren commented on Jan 7, 2020

    @wholmgren
    MemberAuthor

    Great, thanks, let us know if you need anything to get started!

  4. cwhanse commented on Jan 8, 2020

    @cwhanse
    Member

    @wholmgren @souravsingh the current references are being formatted as footnotes rather than citations, since the callouts start with a numeral as the first character. Compare the footnote format to the citation format.

    If we switch to citations, I think it is possible to collect references in a common source file. Worth discussing if we want to do that; it would save a lot of repeated docstring text.

  5. wholmgren commented on Jan 9, 2020

    @wholmgren
    MemberAuthor

    @cwhanse is the only change that we use strings (e.g. _[myref]) instead of integers (e.g. _[1])? I don't see any other difference (e.g. to the conf.py file).

    it would save a lot of repeated docstring text.

    I can see some pros (less repetition, all references in one place) and cons (references are farther from the relevant code), but I think I'd go for it. Do you know of other projects that take this approach?

  6. cwhanse commented on Jan 9, 2020

    @cwhanse
    Member

    scipy uses both styles (footnote and citation), e.g. nonlin.py it appears that the style is up to the implementer. scipy puts citations with each function, and repeats the docstring text where the citation applies to more than one function. The scipy docs style avoids formatting numbered citation callouts as superscripts (footnote style), e.g. newton-krylov

    I don't have a strong preference for either [1] or [Perez90]. It would be nice to not see callouts as superscripts, but that's a nice-to-have.

    I'm now -1 on collecting references into a common file. That may be advantageous for documentation pages, but I see removing the references from each function is a step backwards and isn't worth the small gain of removing repeated text from docstrings.

  7. modified the milestones: 0.8.0, Someday on Aug 28, 2020
  8. wholmgren commented on Oct 29, 2026

    @wholmgren
    MemberAuthor

    closing so there is one fewer issue to attract AI spam

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions