Merge branch 'master' into devel

This commit is contained in:
Max Zwiessele 2015-09-10 14:46:00 +01:00
commit fed97b6683
20 changed files with 28 additions and 25 deletions

View file

@ -28,11 +28,11 @@ try:
#Get rid of nose dependency by only ignoring if you have nose installed #Get rid of nose dependency by only ignoring if you have nose installed
from nose.tools import nottest from nose.tools import nottest
@nottest @nottest
def tests(): def tests(verbose=10):
Tester(testing).test(verbose=10) Tester(testing).test(verbose=verbose)
except: except:
def tests(): def tests(verbose=10):
Tester(testing).test(verbose=10) Tester(testing).test(verbose=verbose)
def load(file_path): def load(file_path):
""" """

View file

@ -1 +1 @@
__version__ = "0.8.3" __version__ = "0.8.4"

View file

@ -3,7 +3,7 @@
import numpy as np import numpy as np
try: try:
import pylab as pb from matplotlib import pyplot as pb
except: except:
pass pass
import GPy import GPy

View file

@ -77,7 +77,7 @@ def student_t_approx(optimize=True, plot=True):
debug=True debug=True
if debug: if debug:
m4.optimize(messages=1) m4.optimize(messages=1)
import pylab as pb from matplotlib import pyplot as pb
pb.plot(m4.X, m4.inference_method.f_hat) pb.plot(m4.X, m4.inference_method.f_hat)
pb.plot(m4.X, m4.Y, 'rx') pb.plot(m4.X, m4.Y, 'rx')
m4.plot() m4.plot()

View file

@ -5,7 +5,7 @@
Gaussian Processes regression examples Gaussian Processes regression examples
""" """
try: try:
import pylab as pb from matplotlib import pyplot as pb
except: except:
pass pass
import numpy as np import numpy as np

View file

@ -105,7 +105,7 @@ class IndependentOutputs(CombinationKernel):
if X2 is None: if X2 is None:
# TODO: make use of index_to_slices # TODO: make use of index_to_slices
# FIXME: Broken as X is already sliced out # FIXME: Broken as X is already sliced out
print("Warning, gradients_X may not be working, I believe X has already been sliced out by the slicer!") # print("Warning, gradients_X may not be working, I believe X has already been sliced out by the slicer!")
values = np.unique(X[:,self.index_dim]) values = np.unique(X[:,self.index_dim])
slices = [X[:,self.index_dim]==i for i in values] slices = [X[:,self.index_dim]==i for i in values]
[target.__setitem__(s, kern.gradients_X(dL_dK[s,s],X[s],None)) [target.__setitem__(s, kern.gradients_X(dL_dK[s,s],X[s],None))

View file

@ -251,7 +251,7 @@ class HessianChecker(GradientChecker):
print(grad_string) print(grad_string)
if plot: if plot:
import pylab as pb from matplotlib import pyplot as pb
fig, axes = pb.subplots(2, 2) fig, axes = pb.subplots(2, 2)
max_lim = numpy.max(numpy.vstack((analytic_hess, numeric_hess))) max_lim = numpy.max(numpy.vstack((analytic_hess, numeric_hess)))
min_lim = numpy.min(numpy.vstack((analytic_hess, numeric_hess))) min_lim = numpy.min(numpy.vstack((analytic_hess, numeric_hess)))

View file

@ -4,4 +4,8 @@
try: try:
from . import matplot_dep from . import matplot_dep
except (ImportError, NameError): except (ImportError, NameError):
print('Fail to load GPy.plotting.matplot_dep.') # Matplotlib not available
import warnings
warnings.warn(ImportWarning("Matplotlib not available, install newest version of Matplotlib for plotting"))
#sys.modules['matplotlib'] =
#sys.modules[__name__+'.matplot_dep'] = ImportWarning("Matplotlib not available, install newest version of Matplotlib for plotting")

View file

@ -3,7 +3,7 @@
import matplotlib as mpl import matplotlib as mpl
import pylab as pb from matplotlib import pyplot as pb
import sys import sys
#sys.path.append('/home/james/mlprojects/sitran_cluster/') #sys.path.append('/home/james/mlprojects/sitran_cluster/')
#from switch_pylab_backend import * #from switch_pylab_backend import *
@ -159,7 +159,7 @@ cdict_Alu = {'red' :((0./5,colorsRGB['Aluminium1'][0]/256.,colorsRGB['Aluminium1
# cmap_BGR = mpl.colors.LinearSegmentedColormap('TangoRedBlue',cdict_BGR,256) # cmap_BGR = mpl.colors.LinearSegmentedColormap('TangoRedBlue',cdict_BGR,256)
# cmap_RB = mpl.colors.LinearSegmentedColormap('TangoRedBlue',cdict_RB,256) # cmap_RB = mpl.colors.LinearSegmentedColormap('TangoRedBlue',cdict_RB,256)
if __name__=='__main__': if __name__=='__main__':
import pylab as pb from matplotlib import pyplot as pb
pb.figure() pb.figure()
pb.pcolor(pb.rand(10,10),cmap=cmap_RB) pb.pcolor(pb.rand(10,10),cmap=cmap_RB)
pb.colorbar() pb.colorbar()

View file

@ -4,7 +4,7 @@
try: try:
#import Tango #import Tango
import pylab as pb from matplotlib import pyplot as pb
except: except:
pass pass
import numpy as np import numpy as np

View file

@ -2,7 +2,7 @@
# Licensed under the BSD 3-clause license (see LICENSE.txt) # Licensed under the BSD 3-clause license (see LICENSE.txt)
try: try:
import pylab as pb from matplotlib import pyplot as pb
except: except:
pass pass
#import numpy as np #import numpy as np

View file

@ -2,7 +2,7 @@
# Licensed under the BSD 3-clause license (see LICENSE.txt) # Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np import numpy as np
import pylab as pb from matplotlib import pyplot as pb
import Tango import Tango
from matplotlib.textpath import TextPath from matplotlib.textpath import TextPath
from matplotlib.transforms import offset_copy from matplotlib.transforms import offset_copy

View file

@ -4,7 +4,7 @@
import numpy as np import numpy as np
try: try:
import Tango import Tango
import pylab as pb from matplotlib import pyplot as pb
except: except:
pass pass
from base_plots import x_frame1D, x_frame2D from base_plots import x_frame1D, x_frame2D

View file

@ -2,7 +2,7 @@
# Licensed under the BSD 3-clause license (see LICENSE.txt) # Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np import numpy as np
try: try:
import pylab as pb from matplotlib import pyplot as pb
from matplotlib.patches import Polygon from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection from matplotlib.collections import PatchCollection
#from matplotlib import cm #from matplotlib import cm

View file

@ -4,7 +4,7 @@
import numpy as np import numpy as np
try: try:
import pylab as pb from matplotlib import pyplot as pb
except: except:
pass pass

View file

@ -2,7 +2,7 @@
# Licensed under the BSD 3-clause license (see LICENSE.txt) # Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np import numpy as np
import pylab as pb from matplotlib import pyplot as pb
def plot(model, ax=None, fignum=None, Z_height=None, **kwargs): def plot(model, ax=None, fignum=None, Z_height=None, **kwargs):

View file

@ -1,4 +1,4 @@
import pylab as pb, numpy as np from matplotlib import pyplot as pb, numpy as np
def plot(parameterized, fignum=None, ax=None, colors=None, figsize=(12, 6)): def plot(parameterized, fignum=None, ax=None, colors=None, figsize=(12, 6)):
""" """

View file

@ -7,7 +7,6 @@ from GPy.models import GradientChecker
import functools import functools
import inspect import inspect
from GPy.likelihoods import link_functions from GPy.likelihoods import link_functions
from GPy.core.parameterization import Param
from functools import partial from functools import partial
fixed_seed = 7 fixed_seed = 7
@ -799,7 +798,7 @@ class LaplaceTests(unittest.TestCase):
post_mean_approx, post_var_approx, = m2.predict(X) post_mean_approx, post_var_approx, = m2.predict(X)
if debug: if debug:
import pylab as pb from matplotlib import pyplot as pb
pb.figure(5) pb.figure(5)
pb.title('posterior means') pb.title('posterior means')
pb.scatter(X, post_mean, c='g') pb.scatter(X, post_mean, c='g')

View file

@ -374,7 +374,7 @@ def football_data(season='1314', data_set='football_data'):
data_resources[data_set_season]['files'] = [files] data_resources[data_set_season]['files'] = [files]
if not data_available(data_set_season): if not data_available(data_set_season):
download_data(data_set_season) download_data(data_set_season)
import pylab as pb from matplotlib import pyplot as pb
for file in reversed(files): for file in reversed(files):
filename = os.path.join(data_path, data_set_season, file) filename = os.path.join(data_path, data_set_season, file)
# rewrite files removing blank rows. # rewrite files removing blank rows.

View file

@ -1,5 +1,5 @@
[bumpversion] [bumpversion]
current_version = 0.8.3 current_version = 0.8.4
tag = True tag = True
commit = True commit = True