From 5a31a9fb2b9442cf676e5520bab9afa522c56005 Mon Sep 17 00:00:00 2001 From: Sofus Rose Date: Tue, 23 Aug 2016 12:40:30 -0400 Subject: [PATCH] Fixed edge case where the sequence input list was 1. --- sRange.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sRange.py b/sRange.py index cc7ecae..6e602da 100644 --- a/sRange.py +++ b/sRange.py @@ -28,7 +28,7 @@ import sys def spSeq(seq, outLen) : perfSep = (1/outLen) * len(seq) - return list(filter(len, [seq[round(perfSep * i):round(perfSep * (i + 1))] for i in range(len(seq))])) + return list(filter(len, [seq[round(perfSep * i):round(perfSep * (i + 1))] for i in range(len(seq))])) if len(seq) > 1 else seq def splitThreadRange(inNum, inThreads) : return [str(l[0]) + '-' + str(l[-1]) for l in spSeq(list(range(inNum)), inThreads)]