@@ -0,0 +1,778 @@
+%22%22%22%0ALearning tests.%0A%22%22%22%0A%0A# pylint: disable=no-member%0A# pylint: disable=missing-docstring%0A%0A# future imports%0Afrom __future__ import division%0Afrom __future__ import absolute_import%0Afrom __future__ import print_function%0A%0Aimport os%0Aimport numpy as np%0Aimport numpy.testing as nt%0A%0Aimport pygp%0Aimport pygp.demos.basic as demo%0A%0A%0Adef test_optimization():%0A    # load the data.%0A    cdir = os.path.abspath(os.path.dirname(demo.__file__))%0A    data = np.load(os.path.join(cdir, 'xy.npz'))%0A    X = data%5B'X'%5D%0A    y = data%5B'y'%5D%0A%0A    # create the model and add data.%0A    gp = pygp.BasicGP(sn=.1, sf=1, ell=.1, mu=0)%0A    gp.add_data(X, y)%0A%0A    # optimize the model%0A    pygp.optimize(gp, %7B'sn': None%7D)%0A%0A    # make sure our constraint is satisfied%0A    nt.assert_equal(gp.get_hyper()%5B0%5D, np.log(0.1))%0A

Add test for the optimizer.