[defaults.cfg] updated so we can ship it

This commit is contained in:
mzwiessele 2015-11-30 10:33:24 +00:00
parent 986e0a4684
commit 065ab725ff
2 changed files with 10 additions and 10 deletions

View file

@ -1,19 +1,16 @@
# This is the default configuration file for GPy
# Do note edit this file.
# For user specific changes edit $HOME/.config/GPy/user.cfg
# For machine specific changes (i.e. those specific to a given installation) edit GPy/installation.cfg
# For user specific changes edit $HOME/.gpy_user.cfg
[parallel]
# Enable openmp support. This speeds up some computations, depending on the number
# of cores available. Setting up a compiler with openmp support can be difficult on
# some platforms, hence by default it is off.
openmp=False
openmp = False
[datasets]
# location for the local data cache
dir=$HOME/tmp/GPy-datasets/
dir = $HOME/tmp/GPy-datasets/
[anaconda]
# if you have an anaconda python installation please specify it here.
@ -30,4 +27,7 @@ working = True
working = True
[plotting]
# Currently supported libraries are: matplotlib, plotly, none.
# for plotly make sure you have setup plotly to load your account.
# none means no plotting will be loaded.
library = matplotlib

View file

@ -5,6 +5,7 @@ from ConfigParser import NoOptionError
current_lib = [None]
supported_libraries = ['matplotlib', 'plotly', 'none']
error_suggestion = "Please make sure you specify your plotting library in your configuration file.\n\n[plotting]\nlibrary = <library>\n\nCurrently supported libraries: {}".format(", ".join(supported_libraries))
def change_plotting_library(lib):
try:
@ -14,7 +15,7 @@ def change_plotting_library(lib):
# This is hooking the library in
# for the usage in GPy:
if lib not in supported_libraries:
print("Warning: Plotting library {} not recognized, make sure the plotting library is one of the following: \n {}".format(lib, ", ".join(supported_libraries)))
raise NoOptionError("Warning: Plotting library {} not recognized, currently supported libraries are: \n {}".format(lib, ", ".join(supported_libraries)))
if lib == 'matplotlib':
import matplotlib
from .matplot_dep.plot_definitions import MatplotlibPlots
@ -28,7 +29,6 @@ def change_plotting_library(lib):
current_lib[0] = None
#===========================================================================
except (ImportError, NameError):
raise
config.set('plotting', 'library', 'none')
import warnings
warnings.warn(ImportWarning("{} not available, install newest version of {} for plotting".format(lib, lib)))
@ -38,12 +38,12 @@ try:
lib = config.get('plotting', 'library')
change_plotting_library(lib)
except NoOptionError:
print("No plotting library was specified. Please make sure you specify your plotting library in your configuration file.\n\n[plotting]\nlibrary = <library>\n\nCurrently supported libraries: {}".format(", ".join(supported_libraries)))
print("No plotting library was specified. \n{}".format(error_suggestion))
def plotting_library():
if current_lib[0] is None:
raise RuntimeError("No plotting library was loaded. Please make sure you specify your plotting library in your configuration file.\n\n[plotting]\nlibrary = <library>\n\nCurrently supported libraries: {}".format(", ".join(supported_libraries)))
raise RuntimeError("No plotting library was loaded. \n{}".format(error_suggestion))
return current_lib[0]
def show(figure, **kwargs):