From 943a56322ef84c7d109f0a27364a257f850ad397 Mon Sep 17 00:00:00 2001 From: fawce Date: Fri, 19 Oct 2012 11:00:28 -0400 Subject: [PATCH] added a __call__ method to BatchTransform to make it useable as a decorator. --- zipline/gens/transform.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zipline/gens/transform.py b/zipline/gens/transform.py index f1c99293..b191ef61 100644 --- a/zipline/gens/transform.py +++ b/zipline/gens/transform.py @@ -454,6 +454,9 @@ class BatchTransform(EventWindow): return self.cached + def __call__(self, f): + self.compute_transform_value = f + return self.handle_data def batch_transform(func): """Decorator function to use instead of inheriting from BatchTransform.