Browse Source

Allow processing 0 lines; warn if data is building up

tags/nilmtools-1.0
Jim Paris 11 years ago
parent
commit
05da75e34a
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      src/filter.py

+ 9
- 2
src/filter.py View File

@@ -375,10 +375,17 @@ class Filter(object):
insert_ctx.send()

# Save the unprocessed parts
if processed > 0:
if processed >= 0:
old_array = array[processed:]
else:
old_array = array
raise Exception(
sprintf("%s return value %s must be >= 0",
str(function), str(processed)))

# Warn if there's too much data remaining
if old_array.shape[0] > 3 * rows:
printf("warning: %d unprocessed rows in buffer\n",
old_array.shape[0])

# Last call for this contiguous interval
if old_array.shape[0] != 0:


Loading…
Cancel
Save