Skip to content

Commit d65e16b

Browse files
committed
Avoid reprocessing already numpydocced docstrings
1 parent 0651b08 commit d65e16b

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
@@ -63,14 +63,21 @@ def rename_references(app, what, name, obj, options, lines,
6363
reference_offset[0] += len(references)
6464

6565

66+
DEDUPLICATION_TAG = ['..', ' processed by numpydoc']
67+
68+
6669
def mangle_docstrings(app, what, name, obj, options, lines):
70+
if lines[-len(DEDUPLICATION_TAG):] == DEDUPLICATION_TAG:
71+
return
6772

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

79+
print(locals())
80+
7481
u_NL = sixu('\n')
7582
if what == 'module':
7683
# Strip top title
@@ -100,6 +107,8 @@ def mangle_docstrings(app, what, name, obj, options, lines):
100107
# duplicates
101108
rename_references(app, what, name, obj, options, lines)
102109

110+
lines += DEDUPLICATION_TAG
111+
103112

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

0 commit comments

Comments
 (0)