From b3e8d56c02ef8fdc51273461586fd8a0ebce03f3 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Sat, 26 Jan 2013 09:43:22 -0500 Subject: [PATCH] Removes unused parameters in test trade info creation. This code hasn't used `random` in a while, removing the parameter left as an artifact. --- zipline/sources/test_source.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/zipline/sources/test_source.py b/zipline/sources/test_source.py index 2525d524..f09174e2 100644 --- a/zipline/sources/test_source.py +++ b/zipline/sources/test_source.py @@ -17,7 +17,6 @@ A source to be used in testing. """ -import random import pytz from itertools import cycle, ifilter, izip @@ -42,29 +41,20 @@ def date_gen(start=datetime(2006, 6, 6, 12, tzinfo=pytz.utc), return (start + (i * delta) for i in xrange(count)) -def mock_prices(count, rand=False): +def mock_prices(count): """ Utility to generate a stream of mock prices. By default - cycles through values from 0.0 to 10.0, n times. Optional - flag to give random values between 0.0 and 10.0 + cycles through values from 0.0 to 10.0, n times. """ - - if rand: - return (random.uniform(1.0, 10.0) for i in xrange(count)) - else: - return (float(i % 10) + 1.0 for i in xrange(count)) + return (float(i % 10) + 1.0 for i in xrange(count)) -def mock_volumes(count, rand=False): +def mock_volumes(count): """ Utility to generate a set of volumes. By default cycles - through values from 100 to 1000, incrementing by 50. Optional - flag to give random values between 100 and 1000. + through values from 100 to 1000, incrementing by 50. """ - if rand: - return (random.randrange(100, 1000) for i in xrange(count)) - else: - return ((i * 50) % 900 + 100 for i in xrange(count)) + return ((i * 50) % 900 + 100 for i in xrange(count)) class SpecificEquityTrades(object):