Skip to content

Commit

Permalink
Rounding some distance functions should fix issue with Python 3.7 pre…
Browse files Browse the repository at this point in the history
…cision.
  • Loading branch information
gugarosa committed Mar 8, 2021
1 parent 61d516c commit 12a6026
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/opfython/math/test_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_jeffreys_distance():

dist = distance.jeffreys_distance(x, y)

assert dist == 0.11883959298241359
assert np.round(dist, 5) == 0.11884


def test_jensen_distance():
Expand All @@ -189,7 +189,7 @@ def test_jensen_distance():

dist = distance.jensen_distance(x, y)

assert dist == 0.0074043973952890585
assert np.round(dist, 5) == 0.00740


def test_jensen_shannon_distance():
Expand All @@ -198,7 +198,7 @@ def test_jensen_shannon_distance():

dist = distance.jensen_shannon_distance(x, y)

assert dist == 0.014808794790576757
assert np.round(dist, 5) == 0.01481


def test_k_divergence_distance():
Expand All @@ -225,7 +225,7 @@ def test_kullback_leibler_distance():

dist = distance.kullback_leibler_distance(x, y)

assert dist == -0.34023041931224646
assert np.round(dist, 5) == -0.34023


def test_log_euclidean_distance():
Expand Down Expand Up @@ -387,7 +387,7 @@ def test_topsoe_distance():

dist = distance.topsoe_distance(x, y)

assert dist == 0.029617589581153514
assert np.round(dist, 5) == 0.02962


def test_vicis_symmetric1_distance():
Expand Down

0 comments on commit 12a6026

Please sign in to comment.