diff options
author | Zachary Sloan | 2013-04-17 19:46:32 +0000 |
---|---|---|
committer | Zachary Sloan | 2013-04-17 19:46:32 +0000 |
commit | 5fcad6ed130424c1cb6adeb15c7ce6547952fd3f (patch) | |
tree | f23afa7c8124ed5d60a0be2eef1b20c0b2536304 /wqflask | |
parent | db7d051ad6e6fbfd986c552ed7e075cce58a04ab (diff) | |
download | genenetwork2-5fcad6ed130424c1cb6adeb15c7ce6547952fd3f.tar.gz |
Fixed small issue with the divide_into_chunks function
that caused one too many chunks to be created
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/my_pylmm/pyLMM/lmm.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py index 59a89ce9..cc155ee0 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py @@ -115,7 +115,7 @@ def divide_into_chunks(the_list, number_chunks): #if remainder: # number_chunks -= 1 - chunksize = int(length / number_chunks) + chunksize = int(length / number_chunks) + 1 print("chunksize:", chunksize) #remainder = length % number_chunks @@ -125,6 +125,7 @@ def divide_into_chunks(the_list, number_chunks): for counter in range(0, length-1, chunksize): print("counter is:", counter) chunks.append(the_list[counter:counter+chunksize]) + print("chunks is now:", chunks) # Deal with remainder #if remainder: @@ -141,8 +142,8 @@ def divide_into_chunks(the_list, number_chunks): def chunk_test(): - the_list = list(range(1, 53)) - results = divide_into_chunks(the_list, 5) + the_list = list(range(1, 57)) + results = divide_into_chunks(the_list, 7) print("results are:", results) def human_association(snp, |