def test_discretize_callable_2d():
 def f(x, y):
  return ((x ** 2) + (y ** 2))
 actual = discretize_model(f, ((-5), 6), ((-5), 6))
 (y, x) = (np.indices((11, 11)) - 5)
 desired = ((x ** 2) + (y ** 2))
 assert_allclose(actual, desired)

def test_discretize_callable_2d ( ) : def f ( x , y ) : return ( ( x ** 2 ) + ( y ** 2 ) ) actual = discretize_model ( f , ( ( - 5 ) , 6 ) , ( ( - 5 ) , 6 ) ) ( y , x ) = ( np . indices ( ( 11 , 11 ) ) - 5 ) desired = ( ( x ** 2 ) + ( y ** 2 ) ) assert_allclose ( actual , desired )
test discretize when a 2d function is passed .