From 16660cf41463f732b91db6bf8e275c09069cf35d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jason=20K=C3=B6lker?= Date: Tue, 2 Apr 2013 20:05:16 -0500 Subject: [PATCH] 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. --- zipline/transforms/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zipline/transforms/utils.py b/zipline/transforms/utils.py index 02d39bad..00423fc7 100644 --- a/zipline/transforms/utils.py +++ b/zipline/transforms/utils.py @@ -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()