def test_crossintray_dim_fail(outdim): """Test crossintray dim exception""" with pytest.raises(IndexError): fx.crossintray(outdim)
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_output(x, minima): """Tests crossintray function output.""" assert np.isclose(fx.crossintray(x), minima).all()