From 31d3e9cc34501f6fe6e06f198bb275d15feef72b Mon Sep 17 00:00:00 2001 From: Kamulegeya-Fahad Date: Fri, 22 Oct 2021 20:30:54 -0700 Subject: [PATCH 1/3] fixed a simple issue where the function 'get loop branches' expected loops in an array yet they are in a list --- looplib/looptools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/looplib/looptools.py b/looplib/looptools.py index 9ad4cd4..a844d67 100644 --- a/looplib/looptools.py +++ b/looplib/looptools.py @@ -89,6 +89,9 @@ def get_loop_branches(parents, loops=None): '''Get the list of list of daughter loops. If `loops` is provided, sort the daughter loops according to their position along the loop. ''' + + loops=np.array(loops) + nloops = len(parents) children = [np.where(parents==i)[0] for i in range(nloops)] if not (loops is None): From 9cfdd84ca75b12296262916e7e7189683f1fe267 Mon Sep 17 00:00:00 2001 From: Kamulegeya-Fahad Date: Fri, 22 Oct 2021 20:30:54 -0700 Subject: [PATCH 2/3] fixed a simple issue where the function 'get loop branches' expected loops in an array yet they are in a list --- looplib/looptools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/looplib/looptools.py b/looplib/looptools.py index 9ad4cd4..a844d67 100644 --- a/looplib/looptools.py +++ b/looplib/looptools.py @@ -89,6 +89,9 @@ def get_loop_branches(parents, loops=None): '''Get the list of list of daughter loops. If `loops` is provided, sort the daughter loops according to their position along the loop. ''' + + loops=np.array(loops) + nloops = len(parents) children = [np.where(parents==i)[0] for i in range(nloops)] if not (loops is None): From 1a88fbaa24dac65dac4f21fda15baa5aeb05c3b8 Mon Sep 17 00:00:00 2001 From: Kamulegeya-Fahad Date: Fri, 24 Dec 2021 12:35:55 -0800 Subject: [PATCH 3/3] modified position of earlier correction --- looplib/looptools.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/looplib/looptools.py b/looplib/looptools.py index a844d67..01212ea 100644 --- a/looplib/looptools.py +++ b/looplib/looptools.py @@ -89,12 +89,11 @@ def get_loop_branches(parents, loops=None): '''Get the list of list of daughter loops. If `loops` is provided, sort the daughter loops according to their position along the loop. ''' - - loops=np.array(loops) nloops = len(parents) children = [np.where(parents==i)[0] for i in range(nloops)] if not (loops is None): + loops=np.array(loops) for i in range(nloops): children[i] = children[i][np.argsort(loops[:,0][children[i]])] return children