From 220bca5bc3a71f70361f5dd48b69f04df2c0fcec Mon Sep 17 00:00:00 2001 From: j45856021-dev <259477747+j45856021-dev@users.noreply.github.com> Date: Fri, 16 Oct 2026 07:24:59 -0700 Subject: [PATCH] Avoid rendering module API members twice 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 #527. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- RELEASES.md | 1 + docs/source/_templates/module.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index 8b5aff51d..d01ff927f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -18,6 +18,7 @@ #### Closed issues +- Fix duplicate function and class descriptions in generated module API pages while preserving top-level aliases and example backreferences (Issue #527) - Fix internal arrays created on the torch default device instead of the input device in `ot.partial.partial_wasserstein`, `ot.wasserstein_circle` (and `ot.sliced_wasserstein_sphere`), the high-dimensional Bures-Wasserstein functions in `ot.gaussian`, `ot.gmm`, `ot.lowrank_sinkhorn` with `init="deterministic"`, the semi-relaxed (F)GW barycenters and `ot.utils.projection_sparse_simplex`, which made them fail on GPU inputs. Add a `meta_default_device` test fixture to catch such allocations on CPU (PR #883, Issue #852) - Allow `NumpyBackend.seed` to adopt an existing `np.random.RandomState` instance and remove NumPy-specific random sampling paths in sliced utilities (PR #849, Issue #848) - Remove a leftover debug `print` from `ot.utils.projection_sparse_simplex` with `axis=1`, and make the `ot.datasets.make_gauss_hd` docstring a raw string so importing `ot` no longer emits a `SyntaxWarning` (PR #860) diff --git a/docs/source/_templates/module.rst b/docs/source/_templates/module.rst index 495995ead..a5f966bf9 100644 --- a/docs/source/_templates/module.rst +++ b/docs/source/_templates/module.rst @@ -3,6 +3,7 @@ .. automodule:: {{ fullname }} :members: + :exclude-members: {{ (functions + classes) | join(', ') }} {% block functions %} {% if functions %}