generated from roboflow/template-python
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Convert docstring examples to functional doctests #2117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Copilot
wants to merge
35
commits into
develop
Choose a base branch
from
copilot/convert-docstrings-to-doctests
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Borda <[email protected]>
…ules Co-authored-by: Borda <[email protected]>
Co-authored-by: Borda <[email protected]>
Co-authored-by: Borda <[email protected]>
Co-authored-by: Borda <[email protected]>
Co-authored-by: Borda <[email protected]>
… format in core.py - Converted all ```python blocks to >>> doctest format with # doctest: +SKIP - Changed continuation lines to use ... - Converted output comments like # array([...]) to proper doctest format - Affected blocks include: * Google Gemini 2.5 (from_lmm and from_vlm) * Moondream (from_lmm and from_vlm) * DeepSeek-VL2 (from_lmm and from_vlm) * PaliGemma (from_vlm) * Qwen2.5-VL and Qwen3-VL (from_vlm) * Google Gemini 2.0 (from_vlm) * from_easyocr, from_ncnn, empty, merge, __getitem__, __setitem__ * box_aspect_ratio, merge_object_detection_pair * google.generativeai thinking_config examples Co-authored-by: Borda <[email protected]>
Co-authored-by: Borda <[email protected]>
Copilot
AI
changed the title
[WIP] Convert Python code examples to functional doctests
Convert docstring examples to functional doctests
Jan 30, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Converted all method/function-level Python code examples from markdown blocks to executable doctest format. This enables automatic validation of documentation examples against the actual codebase.
Changes
36 files converted with 151 doctests (98 executable, 53 skipped for external dependencies):
Format conversion
Before:
After:
Handling external dependencies
Examples requiring non-core dependencies (ultralytics, transformers, inference) use
# doctest: +SKIP:Intentionally not converted
Class-level overview documentation in
detection/core.pyandkey_points/core.pyretains markdown format. These use MkDocs tab syntax (=== "Framework") for multi-framework integration examples and serve documentation purposes, not testing.Validation
pytest supervision/ --doctest-modules -v # 98 passed, 53 skippedOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.