diff --git a/GPy/models/sparse_gp_minibatch.py b/GPy/models/sparse_gp_minibatch.py index a6081e61..d3bbe5fe 100644 --- a/GPy/models/sparse_gp_minibatch.py +++ b/GPy/models/sparse_gp_minibatch.py @@ -50,7 +50,7 @@ class SparseGPMiniBatch(SparseGP): inference_method = var_dtc.VarDTC(limit=1 if not self.missing_data else Y.shape[1]) else: #inference_method = ?? - raise NotImplementedError, "what to do what to do?" + raise NotImplementedError("what to do what to do?") print("defaulting to ", inference_method, "for latent function inference") self.kl_factr = 1. diff --git a/GPy/plotting/matplot_dep/base_plots.py b/GPy/plotting/matplot_dep/base_plots.py index b4142342..f25aee49 100644 --- a/GPy/plotting/matplot_dep/base_plots.py +++ b/GPy/plotting/matplot_dep/base_plots.py @@ -133,7 +133,7 @@ def x_frame1D(X,plot_limits=None,resolution=None): elif len(plot_limits)==2: xmin, xmax = plot_limits else: - raise ValueError, "Bad limits for plotting" + raise ValueError("Bad limits for plotting") Xnew = np.linspace(xmin,xmax,resolution or 200)[:,None] return Xnew, xmin, xmax @@ -149,7 +149,7 @@ def x_frame2D(X,plot_limits=None,resolution=None): elif len(plot_limits)==2: xmin, xmax = plot_limits else: - raise ValueError, "Bad limits for plotting" + raise ValueError("Bad limits for plotting") resolution = resolution or 50 xx,yy = np.mgrid[xmin[0]:xmax[0]:1j*resolution,xmin[1]:xmax[1]:1j*resolution] diff --git a/GPy/plotting/matplot_dep/dim_reduction_plots.py b/GPy/plotting/matplot_dep/dim_reduction_plots.py index 982f8fa9..2c243e13 100644 --- a/GPy/plotting/matplot_dep/dim_reduction_plots.py +++ b/GPy/plotting/matplot_dep/dim_reduction_plots.py @@ -27,7 +27,7 @@ def most_significant_input_dimensions(model, which_indices): try: input_1, input_2 = np.argsort(model.input_sensitivity())[::-1][:2] except: - raise ValueError, "cannot automatically determine which dimensions to plot, please pass 'which_indices'" + raise ValueError("cannot automatically determine which dimensions to plot, please pass 'which_indices'") else: input_1, input_2 = which_indices return input_1, input_2 @@ -133,7 +133,7 @@ def plot_latent(model, labels=None, which_indices=None, try: xmin, xmax, ymin, ymax = plot_limits except (TypeError, ValueError) as e: - raise e.__class__, "Wrong plot limits: {} given -> need (xmin, xmax, ymin, ymax)".format(plot_limits) + raise e.__class__("Wrong plot limits: {} given -> need (xmin, xmax, ymin, ymax)".format(plot_limits)) view = ImshowController(ax, plot_function, (xmin, ymin, xmax, ymax), resolution, aspect=aspect, interpolation='bilinear', diff --git a/GPy/plotting/matplot_dep/kernel_plots.py b/GPy/plotting/matplot_dep/kernel_plots.py index fc061ca7..aa015009 100644 --- a/GPy/plotting/matplot_dep/kernel_plots.py +++ b/GPy/plotting/matplot_dep/kernel_plots.py @@ -132,7 +132,7 @@ def plot(kernel,x=None, fignum=None, ax=None, title=None, plot_limits=None, reso elif len(plot_limits) == 2: xmin, xmax = plot_limits else: - raise ValueError, "Bad limits for plotting" + raise ValueError("Bad limits for plotting") Xnew = np.linspace(xmin, xmax, resolution or 201)[:, None] Kx = kernel.K(Xnew, x) @@ -154,7 +154,7 @@ def plot(kernel,x=None, fignum=None, ax=None, title=None, plot_limits=None, reso elif len(plot_limits) == 2: xmin, xmax = plot_limits else: - raise ValueError, "Bad limits for plotting" + raise ValueError("Bad limits for plotting") resolution = resolution or 51 xx, yy = np.mgrid[xmin[0]:xmax[0]:1j * resolution, xmin[1]:xmax[1]:1j * resolution] @@ -168,4 +168,4 @@ def plot(kernel,x=None, fignum=None, ax=None, title=None, plot_limits=None, reso ax.set_ylabel("x2") ax.set_title("k(x1,x2 ; %0.1f,%0.1f)" % (x[0, 0], x[0, 1])) else: - raise NotImplementedError, "Cannot plot a kernel with more than two input dimensions" + raise NotImplementedError("Cannot plot a kernel with more than two input dimensions") diff --git a/GPy/plotting/matplot_dep/mapping_plots.py b/GPy/plotting/matplot_dep/mapping_plots.py index 6156687d..53bc1de2 100644 --- a/GPy/plotting/matplot_dep/mapping_plots.py +++ b/GPy/plotting/matplot_dep/mapping_plots.py @@ -81,4 +81,4 @@ def plot_mapping(self, plot_limits=None, which_data='all', which_parts='all', re ax.set_ylim(xmin[1], xmax[1]) else: - raise NotImplementedError, "Cannot define a frame with more than two input dimensions" + raise NotImplementedError("Cannot define a frame with more than two input dimensions") diff --git a/GPy/plotting/matplot_dep/models_plots.py b/GPy/plotting/matplot_dep/models_plots.py index d2d5a8e2..5cdf69fc 100644 --- a/GPy/plotting/matplot_dep/models_plots.py +++ b/GPy/plotting/matplot_dep/models_plots.py @@ -175,7 +175,7 @@ def plot_fit(model, plot_limits=None, which_data_rows='all', plots['inducing_inputs'] = ax.plot(Zu[:,0], Zu[:,1], 'wo') else: - raise NotImplementedError, "Cannot define a frame with more than two input dimensions" + raise NotImplementedError("Cannot define a frame with more than two input dimensions") return plots def plot_fit_f(model, *args, **kwargs): diff --git a/GPy/plotting/matplot_dep/priors_plots.py b/GPy/plotting/matplot_dep/priors_plots.py index 8f02a03b..39dad631 100644 --- a/GPy/plotting/matplot_dep/priors_plots.py +++ b/GPy/plotting/matplot_dep/priors_plots.py @@ -29,4 +29,4 @@ def plot(prior): pb.contour(xx, yy, zz, linewidths=2) else: - raise NotImplementedError, "Cannot define a frame with more than two input dimensions" + raise NotImplementedError("Cannot define a frame with more than two input dimensions") diff --git a/GPy/plotting/matplot_dep/visualize.py b/GPy/plotting/matplot_dep/visualize.py index 50eb4b82..97f2c88b 100644 --- a/GPy/plotting/matplot_dep/visualize.py +++ b/GPy/plotting/matplot_dep/visualize.py @@ -25,10 +25,10 @@ class data_show: # If no axes are defined, create some. def modify(self, vals): - raise NotImplementedError, "this needs to be implemented to use the data_show class" + raise NotImplementedError("this needs to be implemented to use the data_show class") def close(self): - raise NotImplementedError, "this needs to be implemented to use the data_show class" + raise NotImplementedError("this needs to be implemented to use the data_show class") class vpython_show(data_show): """ @@ -403,7 +403,7 @@ class mocap_data_show_vpython(vpython_show): self.modify_vertices() def process_values(self): - raise NotImplementedError, "this needs to be implemented to use the data_show class" + raise NotImplementedError("this needs to be implemented to use the data_show class") class mocap_data_show(matplotlib_show): """Base class for visualizing motion capture data.""" @@ -455,7 +455,7 @@ class mocap_data_show(matplotlib_show): self.axes.figure.canvas.draw() def process_values(self): - raise NotImplementedError, "this needs to be implemented to use the data_show class" + raise NotImplementedError("this needs to be implemented to use the data_show class") def initialize_axes(self, boundary=0.05): """Set up the axes with the right limits and scaling."""