Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_crossintray_output(x, minima):
"""Tests crossintray function output."""
assert np.isclose(fx.crossintray(x), minima).all()
def test_crossintray_bound_fail(outbound):
"""Test crossintray bound exception"""
with pytest.raises(ValueError):
x = outbound(b["crossintray"].low, b["crossintray"].high, size=(3, 2))
fx.crossintray(x)
def test_crossintray_output_size(common_minima2, targetdim):
"""Test crossintray output size."""
assert fx.crossintray([-10, 0] * common_minima2).shape == targetdim
def test_crossintray_dim_fail(outdim):
"""Test crossintray dim exception"""
with pytest.raises(IndexError):
fx.crossintray(outdim)