def test_change_plotting(self): self.assertRaises(ValueError, change_plotting_library, 'not+in9names') change_plotting_library('none') self.assertRaises(RuntimeError, plotting_library)
from GPy.util.config import config from GPy.plotting import change_plotting_library, plotting_library class ConfigTest(TestCase): def tearDown(self): change_plotting_library('matplotlib') def test_change_plotting(self): self.assertRaises(ValueError, change_plotting_library, 'not+in9names') change_plotting_library('none') self.assertRaises(RuntimeError, plotting_library) change_plotting_library('matplotlib') if config.get('plotting', 'library') != 'matplotlib': raise SkipTest("Matplotlib not installed, not testing plots") try: from matplotlib import cbook, pyplot as plt from matplotlib.testing.compare import compare_images from matplotlib.testing.noseclasses import ImageComparisonFailure except ImportError: raise SkipTest("Matplotlib not installed, not testing plots") extensions = ['npz'] basedir = os.path.dirname(os.path.relpath(os.path.abspath(__file__)))
def tearDown(self): change_plotting_library('matplotlib')
def change_plotting_library(self, library='plotly_offline'): '''Wrapper of GPy.plotting's homonymous function; supported values are: 'matplotlib', 'plotly', 'plotly_online', 'plotly_offline' and 'none'. If 'plotly' then a 3-tuple is returned, with as 1st value the Figure object requiring a .show() to display.''' change_plotting_library(library)