aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2021-11-19 10:40:02 +0300
committerFrederick Muriuki Muriithi2021-11-19 10:40:02 +0300
commit6367350202a4a7eb9c6551d01cc1b4543d2529f0 (patch)
tree620c13ecc1aa7ae20aa7e15956ed69f9d7579396
parent7d4f6d4687f5f821ab03c9b02d235cca00596331 (diff)
downloadgenenetwork3-6367350202a4a7eb9c6551d01cc1b4543d2529f0.tar.gz
Replace use of assert_allclose. Disable linter error
Notes: https://github.com/genenetwork/genenetwork3/pull/56#issuecomment-973798918 * From the notes above, the assert_allclose is a better function for figuring out what failed, unlike the allclose that simply just returns a True/False value. This commit restores the use of the assert_allclose function, and then disables the linter error due to the fact that there is no use of the `self` keyword.
-rw-r--r--tests/unit/test_heatmaps.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit/test_heatmaps.py b/tests/unit/test_heatmaps.py
index 69e1c3c..a88341b 100644
--- a/tests/unit/test_heatmaps.py
+++ b/tests/unit/test_heatmaps.py
@@ -1,7 +1,7 @@
"""Module contains tests for gn3.heatmaps.heatmaps"""
from unittest import TestCase
-from numpy import allclose
+from numpy.testing import assert_allclose
from gn3.heatmaps import (
cluster_traits,
@@ -27,7 +27,7 @@ slinked = (
class TestHeatmap(TestCase):
"""Class for testing heatmap computation functions"""
- def test_cluster_traits(self):
+ def test_cluster_traits(self): # pylint: disable=R0201
"""
Test that the clustering is working as expected.
"""
@@ -42,7 +42,7 @@ class TestHeatmap(TestCase):
(6.84118, 7.08432, 7.59844, 7.08229, 7.26774, 7.24991),
(9.45215, 10.6943, 8.64719, 10.1592, 7.75044, 8.78615),
(7.04737, 6.87185, 7.58586, 6.92456, 6.84243, 7.36913)]
- self.assertTrue(allclose(
+ assert_allclose(
cluster_traits(traits_data_list),
((0.0, 0.20337048635536847, 0.16381088984330505, 1.7388553629398245,
1.5025235756329178, 0.6952839500255574, 1.271661230252733,
@@ -74,7 +74,7 @@ class TestHeatmap(TestCase):
(0.7934461515867415, 0.4497104244247795, 0.7127042590637039,
0.9313185954797953, 1.1683723389247052, 0.23451785425383564,
1.7413442197913358, 0.33370067057028485, 1.3256191648260216,
- 0.0))))
+ 0.0)))
def test_compute_heatmap_order(self):
"""Test the orders."""