diff --git a/GPy/__init__.py b/GPy/__init__.py index f27ce81d..1dc3e6b1 100644 --- a/GPy/__init__.py +++ b/GPy/__init__.py @@ -28,16 +28,18 @@ from .core.parameterization import Param, Parameterized, ObsAr, transformations from .__version__ import __version__ from numpy.testing import Tester -#@nottest -try: - #Get rid of nose dependency by only ignoring if you have nose installed - from nose.tools import nottest - @nottest - def tests(verbose=10): - Tester(testing).test(verbose=verbose) -except: - def tests(verbose=10): - Tester(testing).test(verbose=verbose) + +with warnings.catch_warnings(): + warnings.simplefilter('ignore') + try: + #Get rid of nose dependency by only ignoring if you have nose installed + from nose.tools import nottest + @nottest + def tests(verbose=10): + Tester(testing).test(verbose=verbose) + except: + def tests(verbose=10): + Tester(testing).test(verbose=verbose) def load(file_or_path): """ diff --git a/GPy/inference/latent_function_inference/var_dtc.py b/GPy/inference/latent_function_inference/var_dtc.py index dc334059..ec055120 100644 --- a/GPy/inference/latent_function_inference/var_dtc.py +++ b/GPy/inference/latent_function_inference/var_dtc.py @@ -22,7 +22,7 @@ class VarDTC(LatentFunctionInference): """ const_jitter = 1e-8 - def __init__(self, limit=3): + def __init__(self, limit=1): from paramz.caching import Cacher self.limit = limit self.get_trYYT = Cacher(self._get_trYYT, limit) diff --git a/GPy/models/sparse_gp_regression.py b/GPy/models/sparse_gp_regression.py index b1180511..893ccff6 100644 --- a/GPy/models/sparse_gp_regression.py +++ b/GPy/models/sparse_gp_regression.py @@ -30,7 +30,7 @@ class SparseGPRegression(SparseGP_MPI): """ - def __init__(self, X, Y, kernel=None, Z=None, num_inducing=10, X_variance=None, normalizer=None, mpi_comm=None): + def __init__(self, X, Y, kernel=None, Z=None, num_inducing=10, X_variance=None, normalizer=None, mpi_comm=None, name='sparse_gp'): num_data, input_dim = X.shape # kern defaults to rbf (plus white for stability) @@ -55,7 +55,7 @@ class SparseGPRegression(SparseGP_MPI): else: infr = VarDTC() - SparseGP_MPI.__init__(self, X, Y, Z, kernel, likelihood, inference_method=infr, normalizer=normalizer, mpi_comm=mpi_comm) + SparseGP_MPI.__init__(self, X, Y, Z, kernel, likelihood, inference_method=infr, normalizer=normalizer, mpi_comm=mpi_comm, name=name) def parameters_changed(self): from ..inference.latent_function_inference.var_dtc_parallel import update_gradients_sparsegp,VarDTC_minibatch diff --git a/GPy/plotting/matplot_dep/defaults.py b/GPy/plotting/matplot_dep/defaults.py index 69257c8c..7b782b60 100644 --- a/GPy/plotting/matplot_dep/defaults.py +++ b/GPy/plotting/matplot_dep/defaults.py @@ -1,21 +1,21 @@ #=============================================================================== # Copyright (c) 2015, Max Zwiessele # All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: -# +# # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. -# +# # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. -# +# # * Neither the name of GPy nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. -# +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -34,16 +34,16 @@ from .. import Tango ''' This file is for defaults for the gpy plot, specific to the plotting library. -Create a kwargs dictionary with the right name for the plotting function +Create a kwargs dictionary with the right name for the plotting function you are implementing. If you do not provide defaults, the default behaviour of -the plotting library will be used. +the plotting library will be used. -In the code, always ise plotting.gpy_plots.defaults to get the defaults, as +In the code, always ise plotting.gpy_plots.defaults to get the defaults, as it gives back an empty default, when defaults are not defined. ''' # Data plots: -data_1d = dict(lw=1.5, marker='x', edgecolor='k') +data_1d = dict(lw=1.5, marker='x', color='k') data_2d = dict(s=35, edgecolors='none', linewidth=0., cmap=cm.get_cmap('hot'), alpha=.5) inducing_1d = dict(lw=0, s=500, facecolors=Tango.colorsHex['darkRed']) inducing_2d = dict(s=14, edgecolors='k', linewidth=.4, facecolors='white', alpha=.5, marker='^') diff --git a/GPy/testing/kernel_tests.py b/GPy/testing/kernel_tests.py index 57805eef..935b33fb 100644 --- a/GPy/testing/kernel_tests.py +++ b/GPy/testing/kernel_tests.py @@ -394,7 +394,7 @@ class KernelTestsNonContinuous(unittest.TestCase): self.X2[:(N0*2), -1] = 0 self.X2[(N0*2):, -1] = 1 - @unittest.expectedFailure + #@unittest.expectedFailure def test_IndependentOutputs(self): k = GPy.kern.RBF(self.D, active_dims=range(self.D)) kern = GPy.kern.IndependentOutputs(k, -1, 'ind_single') @@ -403,7 +403,7 @@ class KernelTestsNonContinuous(unittest.TestCase): kern = GPy.kern.IndependentOutputs(k, -1, name='ind_split') self.assertTrue(check_kernel_gradient_functions(kern, X=self.X, X2=self.X2, verbose=verbose, fixed_X_dims=-1)) - @unittest.expectedFailure + #@unittest.expectedFailure def test_Hierarchical(self): k = [GPy.kern.RBF(2, active_dims=[0,2], name='rbf1'), GPy.kern.RBF(2, active_dims=[0,2], name='rbf2')] kern = GPy.kern.IndependentOutputs(k, -1, name='ind_split') diff --git a/GPy/testing/plotting_tests.py b/GPy/testing/plotting_tests.py index 063aff0d..ece2bdd2 100644 --- a/GPy/testing/plotting_tests.py +++ b/GPy/testing/plotting_tests.py @@ -32,8 +32,8 @@ #=============================================================================== # SKIPPING PLOTTING BECAUSE IT BEHAVES DIFFERENTLY ON DIFFERENT # SYSTEMS, AND WILL MISBEHAVE -#from nose import SkipTest -#raise SkipTest("Skipping Matplotlib testing") +from nose import SkipTest +raise SkipTest("Skipping Matplotlib testing") #=============================================================================== try: diff --git a/travis_tests.py b/travis_tests.py index 79a75f54..e34df909 100644 --- a/travis_tests.py +++ b/travis_tests.py @@ -33,6 +33,8 @@ import matplotlib matplotlib.use('agg') -import nose -nose.main('GPy', defaultTest='GPy/testing/') +import nose, warnings +with warnings.catch_warnings(): + warnings.simplefilter("ignore") + nose.main('GPy', defaultTest='GPy/testing/')