Browse Source

fsck: row indices are too big for slice.indices, so calculate manually

Normally, indexes for an array are expected to fit in a platform's
native long (32 or 64-bit).  In nilmdb, tables aren't real arrays and
we need to handle unbounded indices.
tags/nilmdb-1.10.1
Jim Paris 6 years ago
parent
commit
e5efbadc8e
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      nilmdb/fsck/fsck.py

+ 7
- 3
nilmdb/fsck/fsck.py View File

@@ -425,11 +425,15 @@ class Fsck(object):
for intv in ints:
last_ts = None
(stime, etime, spos, epos) = intv
if spos == epos:
continue
for start in xrange(*slice(spos, epos, maxrows).indices(epos)):

# Break interval into maxrows-sized chunks
next_start = spos
while next_start < epos:
start = next_start
stop = min(start + maxrows, epos)
count = stop - start
next_start = stop

# Get raw data, convert to NumPy arary
try:
raw = tab.get_data(start, stop, binary = True)


Loading…
Cancel
Save