def test_compound_model_with_nonstandard_broadcasting():
 offx = Shift(1)
 offy = Shift(2)
 rot = AffineTransformation2D([[0, (-1)], [1, 0]])
 m = ((offx & offy) | rot)
 (x, y) = m(0, 0)
 assert (x == (-2))
 assert (y == 1)
 assert isinstance(x, float)
 assert isinstance(y, float)
 (x, y) = m([0, 1, 2], [0, 1, 2])
 assert np.all((x == [(-2), (-3), (-4)]))
 assert np.all((y == [1, 2, 3]))

def test_compound_model_with_nonstandard_broadcasting ( ) : offx = Shift ( 1 ) offy = Shift ( 2 ) rot = AffineTransformation2D ( [ [ 0 , ( - 1 ) ] , [ 1 , 0 ] ] ) m = ( ( offx & offy ) | rot ) ( x , y ) = m ( 0 , 0 ) assert ( x == ( - 2 ) ) assert ( y == 1 ) assert isinstance ( x , float ) assert isinstance ( y , float ) ( x , y ) = m ( [ 0 , 1 , 2 ] , [ 0 , 1 , 2 ] ) assert np . all ( ( x == [ ( - 2 ) , ( - 3 ) , ( - 4 ) ] ) ) assert np . all ( ( y == [ 1 , 2 , 3 ] ) )
ensure that the standard_broadcasting flag is properly propagated when creating compound models .