|
2 | 2 | """
|
3 | 3 | # pylint: disable=import-outside-toplevel, no-self-use
|
4 | 4 | from unittest import TestCase
|
5 |
| -from numpy import array, nan, isnan, mean, abs, diff |
| 5 | +from numpy import array, nan, isnan, mean, abs as _abs, diff |
6 | 6 | from numpy.testing import assert_almost_equal, assert_array_equal
|
7 | 7 | from scipy.stats import pearsonr
|
8 | 8 |
|
@@ -84,12 +84,12 @@ def test_rescale_threshold(self):
|
84 | 84 | ## high threshold, fewer iterations, substantial difference remaining
|
85 | 85 | rescaled_rdms = rescale(partial_rdms, method='simple', threshold=10)
|
86 | 86 | common_pair = rescaled_rdms.dissimilarities[:, 3]
|
87 |
| - rel_diff = abs(diff(common_pair)/mean(common_pair)) |
| 87 | + rel_diff = _abs(diff(common_pair)/mean(common_pair)) |
88 | 88 | self.assertGreater(rel_diff[0], 0.1)
|
89 | 89 | ## low threshold, more iterations, difference small
|
90 | 90 | rescaled_rdms = rescale(partial_rdms, method='simple', threshold=0.00001)
|
91 | 91 | common_pair = rescaled_rdms.dissimilarities[:, 3]
|
92 |
| - rel_diff = abs(diff(common_pair)/mean(common_pair)) |
| 92 | + rel_diff = _abs(diff(common_pair)/mean(common_pair)) |
93 | 93 | self.assertLess(rel_diff[0], 0.01)
|
94 | 94 |
|
95 | 95 | def test_mean_no_weights(self):
|
|
0 commit comments