MAINT: Use explicit floats in np.full.

This commit is contained in:
Scott Sanderson
2016-09-20 17:12:08 -04:00
parent 48e12a2604
commit 30a1eb66ea
+5 -5
View File
@@ -381,7 +381,7 @@ class TestLinearWeightedMovingAverage(ZiplineTestCase):
today = pd.Timestamp('2015') today = pd.Timestamp('2015')
assets = np.arange(5, dtype=np.int64) assets = np.arange(5, dtype=np.int64)
data = np.arange(50, dtype=float).reshape((10, 5)) data = np.arange(50, dtype=np.float64).reshape((10, 5))
out = np.zeros(data.shape[1]) out = np.zeros(data.shape[1])
wma2.compute(today, assets, out, data) wma2.compute(today, assets, out, data)
@@ -397,9 +397,9 @@ class TestTrueRange(ZiplineTestCase):
assets = np.arange(3, dtype=np.int64) assets = np.arange(3, dtype=np.int64)
out = np.empty(3, dtype=np.float64) out = np.empty(3, dtype=np.float64)
highs = np.full((2, 3), 3) highs = np.full((2, 3), 3.)
lows = np.full((2, 3), 2) lows = np.full((2, 3), 2.)
closes = np.full((2, 3), 1) closes = np.full((2, 3), 1.)
tr.compute(today, assets, out, highs, lows, closes) tr.compute(today, assets, out, highs, lows, closes)
assert_equal(out, np.full((3,), 2)) assert_equal(out, np.full((3,), 2.))