From 60c485c1ed3485dde705201f320809eb632cf358 Mon Sep 17 00:00:00 2001 From: Andrew Daniels Date: Mon, 29 Aug 2016 15:07:08 -0400 Subject: [PATCH] ENH: Adds table_len method to BcolzMinuteBarReader (#1436) To get the length of the underlying table for a given sid. --- zipline/data/minute_bars.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zipline/data/minute_bars.py b/zipline/data/minute_bars.py index db0637a4..a2a1014c 100644 --- a/zipline/data/minute_bars.py +++ b/zipline/data/minute_bars.py @@ -1008,6 +1008,10 @@ class BcolzMinuteBarReader(MinuteBarReader): return carray + def table_len(self, sid): + """Returns the length of the underlying table for this sid.""" + return len(self._open_minute_file('close', sid)) + def get_sid_attr(self, sid, name): sid_subdir = _sid_subdir_path(sid) sid_path = os.path.join(self._rootdir, sid_subdir)