Skip to content

added API docs and demo#9

Open
alexlib wants to merge 6 commits intoOpenPTV:mainfrom
alexlib:integrate_pyptv
Open

added API docs and demo#9
alexlib wants to merge 6 commits intoOpenPTV:mainfrom
alexlib:integrate_pyptv

Conversation

@alexlib
Copy link
Collaborator

@alexlib alexlib commented Mar 15, 2026

This pull request introduces new documentation and supporting assets to explain and demonstrate the unified Python API approach in openptv-python, emphasizing how the library transparently routes operations to pure Python, Numba, or native optv backends. It adds a detailed explainer page, a script to generate machine-specific benchmark artifacts, and example benchmark results to the documentation.

The most important changes are:

Documentation Enhancements:

  • Added a comprehensive documentation page (native_backend_unification.md) describing the unified backend model, current dispatch status, and rationale for a single public Python API that transparently selects the best available backend. This page includes pipeline diagrams, a summary table of benchmark results, and guidance for users and contributors.
  • Updated the documentation index in index.md to include the new backend unification page.

Benchmark Demo and Artifacts:

  • Added a new script (generate_native_stress_demo.py) that runs the native stress benchmark suite, parses the output, and generates machine-specific artifacts: a JSON summary, an SVG chart, and a raw log. This script automates the process of updating benchmark results in the documentation.
  • Added an example JSON benchmark result file (native-stress-demo.json) to the documentation's static assets, showing detailed timings and speedups for each workload stage.

Copilot AI review requested due to automatic review settings March 15, 2026 17:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds documentation and helper scripts to explain and demonstrate the unified Python API/backends approach, including a machine-specific native stress benchmark demo rendered into the docs.

Changes:

  • Added a new docs page describing backend unification and current dispatch status, including an include of generated benchmark results.
  • Added scripts to (a) run/parse the native stress benchmark into JSON/log and (b) render that JSON into a Markdown include used by the docs.
  • Updated docs index, root Makefile docs build, contributor workflow notes, and gitignore to support the new docs assets.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
docs/render_native_stress_demo_include.py Renders a Markdown include from the committed benchmark JSON.
docs/generate_native_stress_demo.py Runs pytest stress benchmark and emits machine-specific JSON/log artifacts.
docs/native_backend_unification.md New explainer page describing unified backend dispatch + embeds generated demo include.
docs/index.md Adds the new explainer page to the docs index.
docs/_static/native-stress-demo.json Adds an example benchmark output JSON for the docs demo.
README.md Updates contributor workflow guidance (uv-first + conda alternative).
Makefile Adds uv env update targets; updates docs-build to generate the md include.
.gitignore Ignores docs/_generated/ outputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +130 to +132
```{include} _generated/native-stress-demo.mdinc
```

Comment on lines +2 to +11
"generated_at": "2026-03-15T12:45:22.894671+00:00",
"python": "/home/user/Documents/GitHub/openptv-python/.venv/bin/python",
"command": [
"/home/user/Documents/GitHub/openptv-python/.venv/bin/python",
"-m",
"pytest",
"-q",
"-s",
"tests/test_native_stress_performance.py"
],
Comment on lines +1 to +6
"""Regenerate the native stress benchmark data assets for the docs.

This script reruns tests/test_native_stress_performance.py, parses the timing
summary lines printed by the test module, and writes machine-specific demo
artifacts under docs/_static/.
"""
alexlib and others added 3 commits March 15, 2026 21:10
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
uv run pyptv works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants