import numpy as np
import matplotlib.pyplot as pl

import pygp as pg
import pybo.models as pbm
import pybo.policies as pbp


if __name__ == '__main__':
    sn  = 0.2
    ell = 0.670104947766
    sf  = 1.25415619045

    model = pbm.Sinusoidal(0.2)
    gp = pg.BasicGP(sn, ell, sf)
    policy = pbp.GPUCB(gp, model.bounds)

    xmin = model.bounds[0][0]
    xmax = model.bounds[0][1]
    X = np.linspace(xmin, xmax, 200)[:, None]
    x = (xmax-xmin) / 2

    for i in xrange(40):
        pg.gpplot(policy.gp, xmin=xmin, xmax=xmax)
        pl.plot(X, policy.get_index(X), lw=2)
        pl.axvline(x, color='r')
        pl.axis('tight')
        pl.axis(xmin=xmin, xmax=xmax)
        pl.draw()

        y = model.get_data(x)
        policy.add_data(x, y)
        x = policy.get_next()

@@ -122,124 +122,62 @@
 p%0A%0A%0A
-if __name__ == '__main__':%0A    sn  = 0.2%0A    ell = 0.670104947766%0A    sf  = 1.25415619045%0A%0A    model = pbm.Sinusoida
+def run_model(Model, sn, ell, sf, T):%0A    model = Mode
 l(0.
@@ -409,10 +409,9 @@
 nge(
-40
+T
 ):%0A 
@@ -681,16 +681,16 @@
 a(x, y)%0A
-
         
@@ -711,8 +711,140 @@
 _next()%0A
+%0A%0Aif __name__ == '__main__':%0A    # run_model(pbm.Sinusoidal, 0.2, 0.70, 1.25, 100)%0A    run_model(pbm.Gramacy, 0.2, 0.05, 1.25, 100)%0A

Add a harder test example.