'A basic test for the `SimplexLSQ` fitter.'

def test_simplex_lsq_fitter(self):

    class Rosenbrock(Fittable2DModel, ):
        a = Parameter()
        b = Parameter()
        @staticmethod
        def evaluate(x, y, a, b):
            return (((a - x) ** 2) + (b * ((y - (x ** 2)) ** 2)))
    x = y = np.linspace((-3.0), 3.0, 100)
    with NumpyRNGContext(_RANDOM_SEED):
        z = Rosenbrock.evaluate(x, y, 1.0, 100.0)
        z += np.random.normal(0.0, 0.1, size=z.shape)
    fitter = SimplexLSQFitter()
    r_i = Rosenbrock(1, 100)
    r_f = fitter(r_i, x, y, z)
    assert_allclose(r_f.parameters, [1.0, 100.0], rtol=0.01)
