Add numpy-style docstrings to public API#32
Merged
MarcSkovMadsen merged 4 commits intomainfrom Feb 9, 2026
Merged
Conversation
Co-authored-by: MarcSkovMadsen <42288570+MarcSkovMadsen@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add numpy style docstrings to core classes
Add numpy-style docstrings to public API
Feb 8, 2026
…cstrings review feedback
MarcSkovMadsen
approved these changes
Feb 9, 2026
Contributor
MarcSkovMadsen
left a comment
There was a problem hiding this comment.
I'm happy. I've:
- Skimmed through the PR
- Done some sample checks
- Had Claude Opus 4.6 locally review the PR
- Create 51 tests covering the examples in the docstrings
- Create 10 test apps covering the examples in the docstrings
- Fix issues identified
| >>> pn.extension() | ||
| >>> | ||
| >>> nodes = [ | ||
| ... NodeSpec(id="1", position={"x": 0, "y": 0}, label="Start").to_dict(), |
Contributor
There was a problem hiding this comment.
The .to_dict is currently needed. But it should not be like that. See #19. Should be fixed later in separate pr.
| ... NodeSpec(id="2", position={"x": 200, "y": 0}, label="Process").to_dict(), | ||
| ... NodeSpec(id="3", position={"x": 400, "y": 0}, label="End").to_dict(), | ||
| ... ] | ||
| >>> edges = [ |
Contributor
There was a problem hiding this comment.
The .to_dict is currently needed. But it should not be like that. See #19. Should be fixed later in separate pr.
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
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.
Core classes lacked meaningful docstrings, showing only brief one-liners in IDE tooltips without parameter details, examples, or usage guidance.
Changes
Enhanced 9 public classes:
SchemaSource,NodeType,EdgeType- Type definition helpersNodeSpec,EdgeSpec- Graph element buildersEditor,JsonEditor,SchemaEditor- Property editorsReactFlow- Main componentEnhanced 9 key methods:
add_node,remove_node,add_edge,remove_edgepatch_node_data,patch_edge_datato_networkx,from_networkxonFormat
Each docstring includes:
:class:,:meth:)Follows numpy convention for Sphinx compatibility and IDE tooltip rendering.
Example
Before:
After:
~35k characters of API documentation added. Enables Sphinx autodoc generation and improves IDE IntelliSense.
Original 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.