BUG: Ensure that the bar count is an integer in minutely mode simple

transforms

total_seconds can return a float, which when divided by `60` would
still yield a float causing a value error when passed to range.
This commit is contained in:
Joe Jevnik
2014-11-17 19:07:25 -05:00
parent 9e94193d4b
commit aac87ada5d
+2 -1
View File
@@ -338,8 +338,9 @@ class SIDData(object):
# 210 minutes in a an early close and 390 in a full day.
ms = sum(210 if d in env.early_closes else 390 for d in ds)
# Add the number of minutes for today.
ms += \
ms += int(
(now - env.get_open_and_close(now)[0]).total_seconds() / 60
)
cls._minute_bar_cache[days] = ms + 1 # Account for this minute