ENH: Allow windows of NumericalExpression.

If all the inputs to an expr are window-safe, then the expr is itself
window-safe.
This commit is contained in:
Scott Sanderson
2016-10-18 14:58:26 -04:00
committed by Joe Jevnik
parent 582c44a4aa
commit bb2d25e67c
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -40,6 +40,7 @@ from zipline.assets.synthetic import make_rotating_equity_info
from zipline.errors import NoFurtherDataError
from zipline.lib.adjustment import MULTIPLY
from zipline.lib.labelarray import LabelArray
from zipline.lib.rank import masked_rankdata_2d
from zipline.pipeline import CustomFactor, Pipeline
from zipline.pipeline.data import Column, DataSet, USEquityPricing
from zipline.pipeline.data.testing import TestingDataSet
+1
View File
@@ -187,6 +187,7 @@ class NumericalExpression(ComputableTerm):
inputs=binds,
expr=expr,
dtype=dtype,
window_safe=all(t.window_safe for t in binds),
)
def _init(self, expr, *args, **kwargs):