From 64363fae31433235080502745f9de5ec56a6f178 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Wed, 3 Oct 2012 11:40:14 -0400 Subject: [PATCH] Applies pep8 and pyflakes recommendations. White space tweaking. --- zipline/algorithm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zipline/algorithm.py b/zipline/algorithm.py index 23cde1d7..2fb4f7a9 100644 --- a/zipline/algorithm.py +++ b/zipline/algorithm.py @@ -101,7 +101,8 @@ class TradingAlgorithm(object): """ if isinstance(source, (list, tuple)): assert start is not None and end is not None, \ - "When providing a list of sources, start and end date have to be specified." + """When providing a list of sources, \ +start and end date have to be specified.""" elif isinstance(source, pd.DataFrame): assert isinstance(source.index, pd.tseries.index.DatetimeIndex) # if DataFrame provided, wrap in DataFrameSource @@ -130,7 +131,6 @@ class TradingAlgorithm(object): return daily_stats - def _create_daily_stats(self, perfs): # create daily and cumulative stats dataframe daily_perfs = [] @@ -141,12 +141,12 @@ class TradingAlgorithm(object): else: cum_perfs.append(perf) - daily_dts = [np.datetime64(perf['period_close'], utc=True) for perf in daily_perfs] + daily_dts = [np.datetime64(perf['period_close'], utc=True) + for perf in daily_perfs] daily_stats = pd.DataFrame(daily_perfs, index=daily_dts) return daily_stats - def add_transform(self, transform_class, tag, *args, **kwargs): """Add a single-sid, sequential transform to the model.