8000 DOC Skip @property on classes in the auto generated API reference (#3… · scikit-learn/scikit-learn@1bd24a2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1bd24a2

Browse files
authored
DOC Skip @Property on classes in the auto generated API reference (#30989)
1 parent 19819bd commit 1bd24a2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/conf.py

+11
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,15 @@ def disable_plot_gallery_for_linkcheck(app):
799799
sphinx_gallery_conf["plot_gallery"] = "False"
800800

801801

802+
def skip_properties(app, what, name, obj, skip, options):
803+
"""Skip properties that are fitted attributes"""
804+
if isinstance(obj, property):
805+
if name.endswith("_") and not name.startswith("_"):
806+
return True
807+
808+
return skip
809+
810+
802811
def setup(app):
803812
# do not run the examples when using linkcheck by using a small priority
804813
# (default priority is 500 and sphinx-gallery using builder-inited event too)
@@ -811,6 +820,8 @@ def setup(app):
811820
app.connect("build-finished", make_carousel_thumbs)
812821
app.connect("build-finished", filter_search_index)
813822

823+
app.connect("autodoc-skip-member", skip_properties)
824+
814825

815826
# The following is used by sphinx.ext.linkcode to provide links to github
816827
linkcode_resolve = make_linkcode_resolve(

0 commit comments

Comments
 (0)
0