diff options
author | Rémi Flamary <remi.flamary@gmail.com> | 2017-07-26 11:58:58 +0200 |
---|---|---|
committer | Rémi Flamary <remi.flamary@gmail.com> | 2017-07-26 11:58:58 +0200 |
commit | e0fa14ba146e6f92a3060b5f2f0a5c01bd18bdc4 (patch) | |
tree | d9147274907eab5983d0c6223e5e8503e39efbec /test | |
parent | 109fc2a9243d2c0f9a911fa8c02079d2fc0277ab (diff) |
flake8
Diffstat (limited to 'test')
-rw-r--r-- | test/test_plot.py | 18 | ||||
-rw-r--r-- | test/test_utils.py | 3 |
2 files changed, 9 insertions, 12 deletions
diff --git a/test/test_plot.py b/test/test_plot.py index 69789fa..d826988 100644 --- a/test/test_plot.py +++ b/test/test_plot.py @@ -9,17 +9,17 @@ def test_plot1D_mat(): import ot - n = 100 # nb bins + n_bins = 100 # nb bins # bin positions - x = np.arange(n, dtype=np.float64) + x = np.arange(n_bins, dtype=np.float64) # Gaussian distributions - a = ot.datasets.get_1D_gauss(n, m=20, s=5) # m= mean, s= std - b = ot.datasets.get_1D_gauss(n, m=60, s=10) + a = ot.datasets.get_1D_gauss(n_bins, m=20, s=5) # m= mean, s= std + b = ot.datasets.get_1D_gauss(n_bins, m=60, s=10) # loss matrix - M = ot.dist(x.reshape((n, 1)), x.reshape((n, 1))) + M = ot.dist(x.reshape((n_bins, 1)), x.reshape((n_bins, 1))) M /= M.max() ot.plot.plot1D_mat(a, b, M, 'Cost matrix M') @@ -29,7 +29,7 @@ def test_plot2D_samples_mat(): import ot - n = 50 # nb samples + n_bins = 50 # nb samples mu_s = np.array([0, 0]) cov_s = np.array([[1, 0], [0, 1]]) @@ -37,9 +37,9 @@ def test_plot2D_samples_mat(): mu_t = np.array([4, 4]) cov_t = np.array([[1, -.8], [-.8, 1]]) - xs = ot.datasets.get_2D_samples_gauss(n, mu_s, cov_s) - xt = ot.datasets.get_2D_samples_gauss(n, mu_t, cov_t) + xs = ot.datasets.get_2D_samples_gauss(n_bins, mu_s, cov_s) + xt = ot.datasets.get_2D_samples_gauss(n_bins, mu_t, cov_t) - G = 1.0 * (np.random.rand(n, n) < 0.01) + G = 1.0 * (np.random.rand(n_bins, n_bins) < 0.01) ot.plot.plot2D_samples_mat(xs, xt, G, thr=1e-5) diff --git a/test/test_utils.py b/test/test_utils.py index 0883a8e..fe1b88d 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -3,9 +3,6 @@ import ot import numpy as np -# import pytest - - def test_parmap(): n = 100 |