Skip to content

Commit

Permalink
Remove outputs check; by definition, attribute is in outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichalowicz committed Apr 12, 2016
1 parent 6bf612b commit bfdb648
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
10 changes: 0 additions & 10 deletions zipline/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,16 +433,6 @@ class TermInputsNotSpecified(ZiplineError):
msg = "{termname} requires inputs, but no inputs list was passed."


class TermOutputsNotSpecified(ZiplineError):
"""
Raised if a user attempts to construct a term without specifying outputs
and that term does not have class-level default outputs.
"""
msg = (
"{termname} requires outputs, but no outputs list was passed."
)


class WindowLengthNotSpecified(ZiplineError):
"""
Raised if a user attempts to construct a term without specifying window
Expand Down
9 changes: 2 additions & 7 deletions zipline/pipeline/factors/factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from numpy import inf, where
from toolz import curry

from zipline.errors import TermOutputsNotSpecified, UnknownRankMethod
from zipline.errors import UnknownRankMethod
from zipline.lib.normalize import naive_grouped_rowwise_apply
from zipline.lib.rank import masked_rankdata_2d
from zipline.pipeline.classifiers import Classifier, Everything, Quantiles
Expand Down Expand Up @@ -1278,8 +1278,8 @@ def __new__(cls, factor, attribute):
cls,
attribute=attribute,
inputs=[factor],
outputs=factor.outputs,
window_length=0,
mask=factor.mask,
dtype=factor.dtype,
missing_value=factor.missing_value,
)
Expand All @@ -1295,11 +1295,6 @@ def static_identity(cls, attribute, *args, **kwargs):
attribute,
)

def _validate(self):
super(RecarrayFactor, self)._validate()
if not self.outputs:
raise TermOutputsNotSpecified(termname=type(self).__name__)

def _compute(self, windows, dates, assets, mask):
return windows[0][self.attribute]

Expand Down

0 comments on commit bfdb648

Please sign in to comment.