From 54c58d1205978ad3aebc630d69cdf9ff362c744a Mon Sep 17 00:00:00 2001 From: Joe Jevnik Date: Tue, 29 Dec 2015 10:13:00 -0500 Subject: [PATCH] DOC: add comments about the column collection in DataSetMeta --- zipline/pipeline/data/dataset.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zipline/pipeline/data/dataset.py b/zipline/pipeline/data/dataset.py index 3de16220..e65dca39 100644 --- a/zipline/pipeline/data/dataset.py +++ b/zipline/pipeline/data/dataset.py @@ -115,11 +115,13 @@ class DataSetMeta(type): def __new__(mcls, name, bases, dict_): newtype = super(DataSetMeta, mcls).__new__(mcls, name, bases, dict_) + # collect all of the column names that we inherit from our parents column_names = set().union( *(getattr(base, '_column_names', ()) for base in bases) ) for maybe_colname, maybe_column in iteritems(dict_): if isinstance(maybe_column, Column): + # add column names defined on our class bound_column_descr = maybe_column.bind(maybe_colname) setattr(newtype, maybe_colname, bound_column_descr) column_names.add(maybe_colname)