@pytest.mark.parametrize(u'mode', modes)
def test_gaussian_eval_2D(mode):
 model = Gaussian2D(1, 0, 0, 20, 20)
 x = np.arange((-100), 101)
 y = np.arange((-100), 101)
 (x, y) = np.meshgrid(x, y)
 values = model(x, y)
 disc_values = discretize_model(model, ((-100), 101), ((-100), 101), mode=mode)
 assert_allclose(values, disc_values, atol=0.001)

@ pytest . mark . parametrize ( u'mode' , modes ) def test_gaussian_eval_2D ( mode ) : model = Gaussian2D ( 1 , 0 , 0 , 20 , 20 ) x = np . arange ( ( - 100 ) , 101 ) y = np . arange ( ( - 100 ) , 101 ) ( x , y ) = np . meshgrid ( x , y ) values = model ( x , y ) disc_values = discretize_model ( model , ( ( - 100 ) , 101 ) , ( ( - 100 ) , 101 ) , mode = mode ) assert_allclose ( values , disc_values , atol = 0.001 )
discretize gaussian with different modes and check if result is at least similar to gaussian1d .