CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-numpydoc

Sphinx extension to support docstrings in Numpy format

52%

Overall

Evaluation52%

1.13x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-9/

Configurable Class Documentation Renderer

Render NumPy-style class docstrings to reStructuredText while letting callers toggle which class members appear and how attributes are formatted.

Test Fixtures

  • Tests define a base class BaseWidget with a NumPy-style docstring containing an Attributes section for base_attr and a method ping.
  • Tests define a subclass FancyWidget with its own Attributes entry name and method do, inheriting from BaseWidget.
  • The renderer should honor these docstrings and any inherited members without mutating the classes.

Capabilities

Member visibility toggles

  • Calling the renderer with include_members=False emits only the class summary/parameter section; no attribute or method listing appears in the output. @test
  • With include_members=True and include_inherited=False, the output lists only FancyWidget's own attribute and method names. @test

Inherited member inclusion

  • With include_members=True and include_inherited=True, the output also lists inherited attribute and method names from BaseWidget. @test

Attribute formatting

  • With attributes_as_params=True, attributes render as parameter-style entries (name followed by type and description) rather than a raw bulleted list. @test
  • With attributes_as_params=False, attributes render in the standard attributes section format instead of parameter-style entries. @test

Member toctree

  • When members_toctree=True, the rendered output includes a members table-of-contents that links to each listed member. @test

Implementation

@generates

API

from typing import Type

def render_class_doc(
    obj: Type,
    include_members: bool = True,
    include_inherited: bool = False,
    attributes_as_params: bool = True,
    members_toctree: bool = False,
) -> str:
    """
    Render the docstring for a class to reStructuredText, honoring toggles for
    class member inclusion, inherited members, attribute formatting style, and
    per-member table of contents generation.
    """

Dependencies { .dependencies }

numpydoc { .dependency }

Use the docstring rendering extension to build the class documentation with configurable member visibility and attribute formatting. @satisfied-by

tessl i tessl/pypi-numpydoc@1.9.0

tile.json