Repository navigation
[MRG] Avoid rendering module API members twice - #891
Open
j45856021-dev wants to merge 1 commit into
Open
j45856021-dev wants to merge 1 commit into
j45856021-dev wants to merge 1 commit into
Conversation
Exclude functions and classes already rendered by the autosummary template's explicit directives from automodule's member expansion. Keep re-exported APIs, exceptions and gallery backreferences intact. Fixes PythonOT#527. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #891 +/- ##
=======================================
Coverage 97.00% 97.00%
=======================================
Files 130 130
Lines 26842 26842
=======================================
Hits 26039 26039
Misses 803 803 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Types of changes
Documentation bug fix.
Motivation and context / Related issue
Fixes #527.
The module template renders functions and classes through both
automodule :members:and its explicitautofunction/autoclassloops. Exclude the explicitly rendered names from the automatic expansion, retaining the loops and their gallery backreferences.Keeping
:members:matters: package re-exports such asot.bregman.sinkhorn, and theot.utils.UndefinedParameterexception, are documented through that path rather than the function/class loops. Top-level aliases inall.rstare unchanged.How has this been tested (if it applies)
Built native POT from
c02a25cbb0536bd53ba071acd03733c52c2f3be5and generated the complete HTML documentation before and after the change, using Python 3.13.16 and Sphinx 9.1.0 on macOS:A rendered-HTML regression fails on the original
unifduplication and passes after the change. For example, after that build:The broader HTML comparison preserves all 992 distinct module API objects across 27 pages, their canonical anchors, all 116 gallery-backreference links, and all 53 top-level alias definitions. It removes 829 redundant rendered definitions. Local fragment-link checks find no new broken links. The applicable Codespell hook and
git diff --checkpass.This is not a warning-free documentation build: warnings decrease from 1,785 to 679, and existing Docutils errors from 28 to 26. The remaining 21 duplicate-object warnings come from the unchanged
OTResult/BaryResultAttributes sections also documenting their properties; those properties now appear twice rather than four times. Existing reference problems also remain, with some previously masked unreferenced-footnote diagnostics becoming visible. Gallery execution, the numerical test suite, and the full pre-commit wrapper were not run.Prepared and validated by an autonomous AI agent (GPT-6 Astra); no independent human review before submission.
PR checklist