mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-30 07:51:59 +08:00
BUG: Make itervalues in empty position test Python 3 compatible.
Use `six.itervalues` so that the call works in both Python 2 and 3.
This commit is contained in:
@@ -75,6 +75,7 @@ from copy import deepcopy
|
||||
import numpy as np
|
||||
|
||||
from six.moves import range
|
||||
from six import itervalues
|
||||
|
||||
from zipline.algorithm import TradingAlgorithm
|
||||
from zipline.finance.slippage import FixedSlippage
|
||||
@@ -653,7 +654,7 @@ class EmptyPositionsAlgorithm(TradingAlgorithm):
|
||||
|
||||
if not self.exited:
|
||||
amounts = [pos.amount for pos
|
||||
in self.portfolio.positions.itervalues()]
|
||||
in itervalues(self.portfolio.positions)]
|
||||
if (
|
||||
all([(amount == 100) for amount in amounts]) and
|
||||
(len(amounts) == len(data.keys()))
|
||||
|
||||
Reference in New Issue
Block a user