From 8979a03bbdbd91ccfa1954cfeb0f6d49b596daf7 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 15 Aug 2022 00:04:49 +0100 Subject: [PATCH] Subtract one from length of list for indices --- modules/chankeep.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/chankeep.py b/modules/chankeep.py index c49d4dd..f0365ee 100644 --- a/modules/chankeep.py +++ b/modules/chankeep.py @@ -304,7 +304,7 @@ def keepChannels(net, listinfo, mean, sigrelay, relay): # newNums = [] flist = [i[0] for i in listinfo] if len(flist) > max_chans: - max_chans = len(flist) + max_chans = len(flist)-1 chosen = sorted(flist, reverse=True, key=lambda x: x[1])[:max_chans] debug(f"keepChannels() {net}: joining {len(chosen)}/{len(flist)} channels") trace(f"keepChannels() {net}: joining:{chosen}") @@ -318,7 +318,7 @@ def keepChannels(net, listinfo, mean, sigrelay, relay): # newNums = [] siglist = [i[0] for i in listinfo if int(i[1]) > mean] if len(siglist) > max_chans: - max_chans = len(siglist) + max_chans = len(siglist)-1 chosen = sorted(siglist, reverse=True, key=lambda x: x[1])[:max_chans] debug(f"keepChannels() {net}: joining {len(chosen)}/{len(siglist)} channels") trace(f"keepChannels() {net}: joining:{chosen}")