Skip to content

DOC: Add how-to guide for extending the NumPy C API - #32784

Draft
BHUVANSH855 wants to merge 1 commit into
numpy:mainfrom
BHUVANSH855:doc/howto-add-c-api
Draft

BHUVANSH855 wants to merge 1 commit into
numpy:mainfrom
BHUVANSH855:doc/howto-add-c-api

Conversation

@BHUVANSH855

Copy link
Copy Markdown
Contributor

PR summary

There is no single place in the NumPy developer guide documenting the full workflow for adding or extending a public C-API entry point. Contributors have had to reverse-engineer the process from existing code and old PRs (see #30264).

This PR adds doc/source/dev/howto-add-c-api.rst, a how-to guide covering:

  • when a public C API is appropriate
  • how to choose the right mechanism (classic MultiArray, ufunc, DType/ArrayMethod, or header-only)
  • the compatibility and versioning workflow (C_API_VERSION, MinVersion, ABI guards)
  • the cversions.py bookkeeping step
  • documentation and testing requirements
  • naming conventions
  • a complete pre-PR checklist

Two small supporting edits:

  • doc/source/dev/index.rst — one toctree entry after development_advanced_debugging
  • doc/source/dev/reviewer_guidelines.rst — one cross-reference sentence in the API changes section pointing to the new guide

Closes #30264

First time contributor introduction

I am a first-time contributor to this part of NumPy's documentation. I currently have one merged PR and two additional PRs open, and I wanted to contribute something concrete and well-researched to the developer documentation.

AI Disclosure

Claude is used to research the NumPy repository and git history and cross-check relevant source files and documentation details.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOC: Create tutorial guide to document the process for extending the NumPy C-API

1 participant