From 1b38c172800b45c04fcf958c4e8712ae7374ea8a Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 12 Dec 2014 21:18:48 -0600 Subject: [PATCH] Beef up docstring --- skimage/external/tifffile/tifffile_local.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/skimage/external/tifffile/tifffile_local.py b/skimage/external/tifffile/tifffile_local.py index 35c826ad..4ddd6763 100644 --- a/skimage/external/tifffile/tifffile_local.py +++ b/skimage/external/tifffile/tifffile_local.py @@ -3085,6 +3085,27 @@ def _replace_by(module_function, package=None, warn=False): This is used to replace local functions with functions from another (usually compiled) module, if available. + + Parameters + ---------- + module_function : str + Module and function path string (e.g. numpy.ones) + package : str, optional + The parent package of the module + warn : bool, optional + Whether to warn when wrapping fails + + Returns + ------- + func : function + Wrapped function, hopefully calling a function in another module. + + Example + ------- + >>> @_replace_by('_tifffile.decodepackbits') + ... def decodepackbits(encoded): + ... raise NotImplementedError + """ def decorate(func, module_function=module_function, warn=warn): try: