Skip to content

Commit

Permalink
Merge pull request #135 from jnothman/deduplicate
Browse files Browse the repository at this point in the history
Avoid reprocessing already numpydocced docstrings
  • Loading branch information
pv committed Nov 1, 2017
2 parents 9d9477f + f902cc7 commit d601f14
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions numpydoc/numpydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ def rename_references(app, what, name, obj, options, lines,
reference_offset[0] += len(references)


DEDUPLICATION_TAG = ' !! processed by numpydoc !!'


def mangle_docstrings(app, what, name, obj, options, lines):
if DEDUPLICATION_TAG in lines:
return

cfg = {'use_plots': app.config.numpydoc_use_plots,
'show_class_members': app.config.numpydoc_show_class_members,
Expand Down Expand Up @@ -100,6 +105,8 @@ def mangle_docstrings(app, what, name, obj, options, lines):
# duplicates
rename_references(app, what, name, obj, options, lines)

lines += ['..', DEDUPLICATION_TAG]


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

0 comments on commit d601f14

Please sign in to comment.