BUG: Preseve docstring in batch functions

The batch_transform decorator wipes out the doc string of the function
it wraps. Decorate the creator with functools.wraps to preserve function
metadata.
This commit is contained in:
Jason Kölker
2013-04-02 20:05:16 -05:00
committed by Eddie Hebert
parent 1906c2d416
commit 16660cf414
+2
View File
@@ -17,6 +17,7 @@
"""
Generator versions of transforms.
"""
import functools
import types
import logbook
import numpy
@@ -594,6 +595,7 @@ def batch_transform(func):
For an example on how to use this, see the doc string of BatchTransform.
"""
@functools.wraps(func)
def create_window(*args, **kwargs):
# passes the user defined function to BatchTransform which it
# will call instead of self.get_value()