Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Docstring interpolation does not work correctly for indented insertions #10161

Closed as not planned
Labels
Documentationstatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Action
@timhoffm

Description

@timhoffm

Bug report

After switching to the numpydoc format, it's a common situation that one wants to add a docstring interpolation to the a parameter entry, e.g.

@docstring.dedent_interpddef axhline(self, y=0, xmin=0, xmax=1, **kwargs):    """    Add a horizontal line across the axis.    [...]    Other Parameters    ----------------    **kwargs :        Valid kwargs are :class:`~matplotlib.lines.Line2D` properties,        with the exception of 'transform':        %(Line2D)s"""

The resulting docstring is:

Other Parameters----------------**kwargs :    Valid kwargs are :class:`~matplotlib.lines.Line2D` properties,    with the exception of 'transform':      agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array   alpha: float (0.0 transparent through 1.0 opaque)   animated: bool   [...]

Note that the first lineagg_filter is correctly indented. However, the following inserted lines are missing the indent before the%(Line2D)s in the original string.

This is a general problem if the inserted string is multi-line (basically always) and the format string should be indented as in the parameter list.

Any clever ideas to get this working?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentationstatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp