mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-27 19:48:43 +08:00
Beef up docstring
This commit is contained in:
+21
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user