Browse Source

Add --max argument for nilm-decimate-auto

This is instead of hardcoding 500
tags/nilmtools-2.0.0
Jim Paris 1 year ago
parent
commit
aae4d79eaf
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      nilmtools/decimate_auto.py

+ 4
- 1
nilmtools/decimate_auto.py View File

@@ -23,6 +23,9 @@ def main(argv = None):
help="NilmDB server URL (default: %(default)s)")
parser.add_argument("-f", "--factor", action="store", default=4, type=int,
help='Decimation factor (default: %(default)s)')
parser.add_argument("-m", "--max", action="store", default=500, type=int,
help='Maximum number of points in last level ' +
'(default: %(default)s)')
parser.add_argument("-F", "--force-metadata", action="store_true",
default = False,
help="Force metadata changes if the dest "
@@ -72,7 +75,7 @@ def do_decimation(client, args, path):
factor = 1
while True:
print("Level", factor, "decimation has", info.rows, "rows")
if info.rows <= 500:
if info.rows <= args.max:
break
factor *= args.factor
new_path = "%s~decim-%d" % (path, factor)


Loading…
Cancel
Save