From 99bfda81abe76b3bb3f7034cf6cdac21c8d50726 Mon Sep 17 00:00:00 2001 From: Muriithi Frederick Muriuki Date: Tue, 17 Aug 2021 11:05:03 +0300 Subject: Make child sequence a list Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Since the `slink` function assigns values to the `listcopy` variable and its children, this commit ensures that the sequence is a list to allow for the assignment. If the child-sequence is a tuple, that would lead to an exception. --- gn3/computations/slink.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gn3/computations/slink.py b/gn3/computations/slink.py index 5953e6b..3d7a576 100644 --- a/gn3/computations/slink.py +++ b/gn3/computations/slink.py @@ -161,7 +161,7 @@ def slink(lists): try: size = len(lists) listindexcopy = list(range(size)) - listscopy = [child[:] for child in lists] + listscopy = [list(child[:]) for child in lists] init_size = size candidate = [] while init_size > 2: -- cgit v1.2.3