From 6a5c2ea1649d7f32910a166673bdff1740b68ff1 Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Thu, 10 Sep 2015 09:26:07 +0100 Subject: [PATCH] [plotting] no printing of warning unless you actually use plotting --- GPy/plotting/__init__.py | 6 +++++- GPy/testing/likelihood_tests.py | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/GPy/plotting/__init__.py b/GPy/plotting/__init__.py index dc15724e..7172543d 100644 --- a/GPy/plotting/__init__.py +++ b/GPy/plotting/__init__.py @@ -4,4 +4,8 @@ try: from . import matplot_dep except (ImportError, NameError): - # Matplotlib not available \ No newline at end of file + # 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") \ No newline at end of file diff --git a/GPy/testing/likelihood_tests.py b/GPy/testing/likelihood_tests.py index 1d181040..1f634848 100644 --- a/GPy/testing/likelihood_tests.py +++ b/GPy/testing/likelihood_tests.py @@ -7,7 +7,6 @@ from GPy.models import GradientChecker import functools import inspect from GPy.likelihoods import link_functions -from GPy.core.parameterization import Param from functools import partial fixed_seed = 7