Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant parametrization from wasserstein_1d tests #517

Merged
merged 5 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions test/test_1d_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
import pytest

import ot
from ot.backend import tf
from ot.lp import wasserstein_1d

from ot.backend import get_backend_list, tf
from scipy.stats import wasserstein_distance

backend_list = get_backend_list()


def test_emd_1d_emd2_1d_with_weights():
# test emd1d gives similar results as emd
Expand Down Expand Up @@ -53,10 +51,7 @@ def test_emd_1d_emd2_1d_with_weights():
np.testing.assert_allclose(w_v, G.sum(0))


@pytest.mark.parametrize('nx', backend_list)
def test_wasserstein_1d(nx):
from scipy.stats import wasserstein_distance

rng = np.random.RandomState(0)

n = 100
Expand Down Expand Up @@ -105,8 +100,6 @@ def test_wasserstein_1d_type_devices(nx):

@pytest.mark.skipif(not tf, reason="tf not installed")
def test_wasserstein_1d_device_tf():
if not tf:
return
nx = ot.backend.TensorflowBackend()
rng = np.random.RandomState(0)
n = 10
Expand Down
2 changes: 0 additions & 2 deletions test/test_ot.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ def test_emd_emd2_types_devices(nx):

@pytest.mark.skipif(not tf, reason="tf not installed")
def test_emd_emd2_devices_tf():
if not tf:
return
nx = ot.backend.TensorflowBackend()

n_samples = 100
Expand Down
Loading