Skip to content

[Docs] Add missing QDP Python API docstrings #1336

@viiccwen

Description

@viiccwen

What

Add missing docstrings for canonical public QDP Python APIs.

The initial API documentation audit found several public-facing methods and helpers in qdp/qdp-python/qumat_qdp that currently have no docstring even though they are part of the user-facing Python surface or interoperability contract.

Examples include:

  • QdpEngine.encode(...)
  • QdpTensor.__dlpack__(...)
  • QdpTensor.__dlpack_device__(...)
  • QdpTensor.to_torch(...)
  • QdpBenchmark builder methods
  • Triton AMD availability and encoding methods

Why

These APIs are the first layer users see when using QDP from Python. Missing docstrings make it harder for users and contributors to understand expected inputs, supported encoding modes, tensor interoperability behavior, and backend availability checks.

This also makes future generated API documentation less useful, because undocumented public members would appear without meaningful descriptions.

How

Add concise reStructuredText-friendly docstrings to the missing public QDP Python API members while keeping the change documentation-only.

The docstrings should:

  • describe what the method or helper does
  • document important parameters and return values where helpful
  • preserve the current behavior without changing runtime logic
  • follow the existing low-churn Python docstring style used in nearby Mahout code

Out of scope:

  • changing runtime behavior
  • adding the Sphinx or rustdoc documentation pipeline
  • documenting backend adapter internals that are not part of the first public API pass

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions