MCPcopy Create free account
hub / github.com/PythonOT/POT / test_not_implemented_method

Function test_not_implemented_method

test/test_bregman.py:77–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75
76
77def test_not_implemented_method():
78 # test sinkhorn
79 w = 10
80 n = w**2
81 rng = np.random.RandomState(42)
82 A_img = rng.rand(2, w, w)
83 A_flat = A_img.reshape(n, 2)
84 a1, a2 = A_flat.T
85 M_flat = ot.utils.dist0(n)
86 not_implemented = "new_method"
87 reg = 0.01
88 with pytest.raises(ValueError):
89 ot.sinkhorn(a1, a2, M_flat, reg, method=not_implemented)
90 with pytest.raises(ValueError):
91 ot.sinkhorn2(a1, a2, M_flat, reg, method=not_implemented)
92 with pytest.raises(ValueError):
93 ot.barycenter(A_flat, M_flat, reg, method=not_implemented)
94 with pytest.raises(ValueError):
95 ot.bregman.barycenter_debiased(A_flat, M_flat, reg, method=not_implemented)
96 with pytest.raises(ValueError):
97 ot.bregman.convolutional_barycenter2d(A_img, reg, method=not_implemented)
98 with pytest.raises(ValueError):
99 ot.bregman.convolutional_barycenter2d_debiased(
100 A_img, reg, method=not_implemented
101 )
102
103
104@pytest.mark.parametrize("method", ["sinkhorn", "sinkhorn_stabilized"])

Callers

nothing calls this directly

Calls 2

randMethod · 0.45
reshapeMethod · 0.45

Tested by

no test coverage detected