BUG: Fix div by 0 error due to changed return type.

When calculate_positions_value used np.dot, the return type was a
np.float64. Which allows the use of 0.0 in division to not raise an
exception.

Fix by expliciting creating an np.float64 with 0 value.
This commit is contained in:
Eddie Hebert
2015-02-20 16:22:06 -05:00
parent 83b0e51b59
commit 1054134bd9
+1 -1
View File
@@ -351,7 +351,7 @@ class PerformancePeriod(object):
def calculate_positions_value(self):
if len(self.position_values) == 0:
return 0
return np.float64(0)
return sum(self.position_values)