From 0263a7c79e3131d42006a38ac2fbb80556506491 Mon Sep 17 00:00:00 2001 From: Muriithi Frederick Muriuki Date: Thu, 22 Jul 2021 13:58:18 +0300 Subject: Check that given list and both coordinates, we get shortest distance * gn3/computations/slink.py: Add code to compute the distance given the coordinate of both members on the parent list/tuple * tests/unit/computations/test_slink.py: * Change the name of the tests to more closely correspond to the business requirement the test is checking for * Update the comments to indicate some more things that might need to be done in the future --- gn3/computations/slink.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gn3/computations') diff --git a/gn3/computations/slink.py b/gn3/computations/slink.py index 7d13d91..7b4016a 100644 --- a/gn3/computations/slink.py +++ b/gn3/computations/slink.py @@ -71,3 +71,5 @@ This description should be updated once the form/type of 'distance' identified." raise_valueerror_on_negative_distances(lists) #### END: Guard Functions #### return None + if type(i) == int and type(j) == int: # From member i to member j + return lists[i][j] -- cgit v1.2.3