Skip to content

Commit

Permalink
Insert metadata in image docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
sciunto committed Aug 5, 2016
1 parent 0ea2a34 commit 48db5d9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions skimage/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,19 @@ def rocket():
"""
return load("rocket.jpg")

def _install_metadata_doc():
import sys
for name in __all__:
if name in ('load', 'lena'):
continue
func = getattr(sys.modules[__name__], name)
addenda = " Shape: %s; dtype: %s" % (func().shape, func().dtype)

docstring = func.__doc__.splitlines()
docstring.insert(1, addenda)
docstring.insert(1, '')
docstring = '\n'.join(docstring)
func.__doc__ = docstring

_install_metadata_doc()

0 comments on commit 48db5d9

Please sign in to comment.