From 2badf7557b03deaecae227ed50b16132d119d246 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Mon, 7 Oct 2013 18:06:05 -0400 Subject: [PATCH] MAINT: Remove redundant create of numpy arrays. Now that the cumulative risk module uses pd.Series instead of lists, it is unnecessary to call `np.array` on the stored values. --- zipline/finance/risk/cumulative.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/zipline/finance/risk/cumulative.py b/zipline/finance/risk/cumulative.py index f067c03b..bddc48b3 100644 --- a/zipline/finance/risk/cumulative.py +++ b/zipline/finance/risk/cumulative.py @@ -317,7 +317,7 @@ algorithm_returns ({algo_count}) in range {start} : {end} on {dt}" if mar is None: mar = self.treasury_period_return - return sortino_ratio(np.array(self.algorithm_returns), + return sortino_ratio(self.algorithm_returns, self.algorithm_period_returns[self.latest_dt], mar) @@ -325,9 +325,8 @@ algorithm_returns ({algo_count}) in range {start} : {end} on {dt}" """ http://en.wikipedia.org/wiki/Information_ratio """ - A = np.array - return information_ratio(A(self.algorithm_returns), - A(self.benchmark_returns)) + return information_ratio(self.algorithm_returns, + self.benchmark_returns) def calculate_alpha(self, dt): """