@pytest.mark.parametrize(u'poly', [Chebyshev2D(1, 2), Polynomial2D(2), Legendre2D(1, 2), Chebyshev1D(5), Legendre1D(5), Polynomial1D(5)])
def test_compound_with_polynomials(poly):
 poly.parameters = [1, 2, 3, 4, 1, 2]
 shift = Shift(3)
 model = (poly | shift)
 (x, y) = np.mgrid[:20, :37]
 result_compound = model(x, y)
 result = shift(poly(x, y))
 assert_allclose(result, result_compound)

@ pytest . mark . parametrize ( u'poly' , [ Chebyshev2D ( 1 , 2 ) , Polynomial2D ( 2 ) , Legendre2D ( 1 , 2 ) , Chebyshev1D ( 5 ) , Legendre1D ( 5 ) , Polynomial1D ( 5 ) ] ) def test_compound_with_polynomials ( poly ) : poly . parameters = [ 1 , 2 , 3 , 4 , 1 , 2 ] shift = Shift ( 3 ) model = ( poly | shift ) ( x , y ) = np . mgrid [ : 20 , : 37 ] result_compound = model ( x , y ) result = shift ( poly ( x , y ) ) assert_allclose ( result , result_compound )
tests that polynomials are scaled when used in compound models .