Skip to content

Commit a0c4b33

Browse files
committed
Avoid reprocessing already numpydocced docstrings
1 parent e32e363 commit a0c4b33

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

numpydoc/numpydoc.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,21 @@ def rename_references(app, what, name, obj, options, lines,
6262
reference_offset[0] += len(references)
6363

6464

65+
DEDUPLICATION_TAG = ['..', ' processed by numpydoc']
66+
67+
6568
def mangle_docstrings(app, what, name, obj, options, lines):
69+
if lines[-len(DEDUPLICATION_TAG):] == DEDUPLICATION_TAG:
70+
return
6671

6772
cfg = {'use_plots': app.config.numpydoc_use_plots,
6873
'show_class_members': app.config.numpydoc_show_class_members,
6974
'show_inherited_class_members':
7075
app.config.numpydoc_show_inherited_class_members,
7176
'class_members_toctree': app.config.numpydoc_class_members_toctree}
7277

78+
print(locals())
79+
7380
u_NL = sixu('\n')
7481
if what == 'module':
7582
# Strip top title
@@ -99,6 +106,8 @@ def mangle_docstrings(app, what, name, obj, options, lines):
99106
# duplicates
100107
rename_references(app, what, name, obj, options, lines)
101108

109+
lines += DEDUPLICATION_TAG
110+
102111

103112
def mangle_signature(app, what, name, obj, options, sig, retann):
104113
# Do not try to inspect classes that don't define `__init__`

0 commit comments

Comments
 (0)