From a50fbe92898e08fe225212368e1c596e8639498f Mon Sep 17 00:00:00 2001 From: Richard Frank Date: Fri, 20 Sep 2013 15:55:09 -0400 Subject: [PATCH] MAINT: Some code cleanup in the blotter module --- zipline/finance/blotter.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/zipline/finance/blotter.py b/zipline/finance/blotter.py index a886f248..9bd1f588 100644 --- a/zipline/finance/blotter.py +++ b/zipline/finance/blotter.py @@ -94,7 +94,7 @@ class Blotter(object): # just validates amount and passes rest on to TransactionSimulator # Tell the user if they try to buy 0 shares of something. - if int(amount) == 0: + if amount == 0: zero_message = "Requested to trade zero shares of {psid}".format( psid=sid ) @@ -104,18 +104,18 @@ class Blotter(object): elif amount > self.max_shares: # Arbitrary limit of 100 billion (US) shares will never be # exceeded except by a buggy algorithm. - raise OverflowError('Can\'t order more than %d shares' % + raise OverflowError("Can't order more than %d shares" % self.max_shares) - order = Order(**{ - 'dt': self.current_dt, - 'sid': sid, - 'amount': amount, - 'filled': 0, - 'stop': stop_price, - 'limit': limit_price, - 'id': order_id - }) + order = Order( + dt=self.current_dt, + sid=sid, + amount=amount, + filled=0, + stop=stop_price, + limit=limit_price, + id=order_id + ) # initialized filled field. order.filled = 0