aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/computations/test_correlation.py
diff options
context:
space:
mode:
authorMuriithi Frederick Muriuki2021-07-26 15:39:42 +0300
committerMuriithi Frederick Muriuki2021-07-26 15:39:42 +0300
commit4c8c13814a22fe6b40081ecfa1f957bc5bf99930 (patch)
tree685b7b0e4ca2b86e13f43235320e80d273a092c8 /tests/unit/computations/test_correlation.py
parent278f1a18b59b1cadd04c50a9af35b5aece4d722d (diff)
downloadgenenetwork3-4c8c13814a22fe6b40081ecfa1f957bc5bf99930.tar.gz
Fix issues caught by pylint
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Fix a myriad of issues caught by pylint to ensure the code passes all tests.
Diffstat (limited to 'tests/unit/computations/test_correlation.py')
-rw-r--r--tests/unit/computations/test_correlation.py32
1 files changed, 17 insertions, 15 deletions
diff --git a/tests/unit/computations/test_correlation.py b/tests/unit/computations/test_correlation.py
index 6153c8a..9450094 100644
--- a/tests/unit/computations/test_correlation.py
+++ b/tests/unit/computations/test_correlation.py
@@ -467,26 +467,28 @@ class TestCorrelation(TestCase):
self.assertEqual(results, [expected_results])
def test_compute_correlation(self):
- for dbdata,userdata,expected in [
- [[None,None,None,None,None,None,None,None,None,None],
- [None,None,None,None,None,None,None,None,None,None],
+ """Test that the new correlation function works the same as the original
+ from genenetwork1."""
+ for dbdata, userdata, expected in [
+ [[None, None, None, None, None, None, None, None, None, None],
+ [None, None, None, None, None, None, None, None, None, None],
(0.0, 0)],
- [[None,None,None,None,None,None,None,None,None,0],
- [None,None,None,None,None,None,None,None,None,None],
+ [[None, None, None, None, None, None, None, None, None, 0],
+ [None, None, None, None, None, None, None, None, None, None],
(0.0, 0)],
- [[None,None,None,None,None,None,None,None,None,0],
- [None,None,None,None,None,None,None,None,None,0],
+ [[None, None, None, None, None, None, None, None, None, 0],
+ [None, None, None, None, None, None, None, None, None, 0],
(0.0, 1)],
- [[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],
+ [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
(0, 10)],
- [[9.87,9.87,9.87,9.87,9.87,9.87,9.87,9.87,9.87,9.87],
- [9.87,9.87,9.87,9.87,9.87,9.87,9.87,9.87,9.87,9.87],
+ [[9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87],
+ [9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87, 9.87],
(0.9999999999999998, 10)],
- [[9.3,2.2,5.4,7.2,6.4,7.6,3.8,1.8,8.4,0.2],
- [0.6,3.97,5.82,8.21,1.65,4.55,6.72,9.5,7.33,2.34],
+ [[9.3, 2.2, 5.4, 7.2, 6.4, 7.6, 3.8, 1.8, 8.4, 0.2],
+ [0.6, 3.97, 5.82, 8.21, 1.65, 4.55, 6.72, 9.5, 7.33, 2.34],
(-0.12720361919462056, 10)],
- [[0,1,2,3,4,5,6,7,8,9],
- [None,None,None,None,2,None,None,3,None,None],
+ [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
+ [None, None, None, None, 2, None, None, 3, None, None],
(0.0, 2)]]:
with self.subTest(dbdata=dbdata, userdata=userdata):
- self.assertEqual(compute_correlation(dbdata,userdata), expected)
+ self.assertEqual(compute_correlation(dbdata, userdata), expected)