docs(python): improve rendering of API docs type signatures, mark PivotOps as deprecated, misc tidy-ups #5388
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.
Signatures
Found a proper Sphinx build-event hook (
autodoc-process-signature
) to take advantage of to try and minimise private classpaths. Annoyingly the event doesn't appear to trigger on every signature, but it does take care of a lot of them. Not obvious why some functions are missed - possibly connected to parsing of@overload
, but not confirmed yet.The newly-registered event handler just applies a simple regex to strip any private paths that appear in the signature; it doesn't look at the rest of the docstring (the mutating function itself, along with registration for the event, can be found in
conf.py
).Before: (polars.internals.expr.expr.Expr)
After: (Expr)
Misc
PivotOps
.polars.datatypes.XYZ
topolars.XYZ
in sidebar nav.venv
(make), don't forget aboutrequirements-docs.txt
:)Contributes to #4156.
More to come...