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-4/

Docstring Cross-Reference Renderer

Create a small utility that turns NumPy-style docstring sections into reStructuredText while cross-referencing type tokens. The renderer must honor alias rules, ignore rules, and default links so that type mentions become Sphinx-friendly references.

Capabilities

Applies alias mapping

  • Given a docstring Parameters entry arr : ndarray, when aliases map ndarray to numpy.ndarray, the rendered output wraps numpy.ndarray in the default cross-reference role instead of ndarray. @test

Skips ignored tokens

  • Given a docstring Parameters entry flag : boolean, when the ignore list includes boolean, the rendered output leaves boolean as plain text with no cross-reference markup. @test

Links remaining tokens

  • Given a docstring with engine : CustomEngine, with no alias or ignore entry, the rendered output wraps CustomEngine in the default cross-reference role. @test

Merges defaults with custom rules

  • In a docstring that includes value : float, frame : DataFrame, and items : Sequence[str], confirm that a custom alias map { "DataFrame": "pandas.DataFrame" } and ignore list ["Sequence"] leave the built-in default link on float, replace DataFrame with the alias target, and keep Sequence unlinked in the rendered output. @test

Implementation

@generates

API

from typing import Mapping, Sequence


def render_param_types(docstring: str, aliases: Mapping[str, str] | None = None, ignore: Sequence[str] | None = None) -> str:
    """Render the parameter and return type tokens from a NumPy-style docstring into reStructuredText, applying cross-reference markup that honors alias and ignore rules while preserving section formatting."""

Dependencies { .dependencies }

numpydoc { .dependency }

Parses and renders NumPy-style docstrings with cross-reference support.

tessl i tessl/pypi-numpydoc@1.9.0

tile.json