[config] default stub install verbose

This commit is contained in:
mzwiessele 2015-10-10 13:32:32 +01:00
parent 3460b967a2
commit 096254a49c
4 changed files with 46 additions and 9 deletions

View file

@ -1,5 +1,18 @@
# This is the local installation configuration file for GPy
# For user specific changes edit $HOME/.config/GPy/user.cfg
[plotting]
library = plotly
#library = matplotlib
# [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 # True
# [datasets]
# location for the local data cache
# dir=$HOME/tmp/GPy-datasets/ # Any other path you choose
# [cython]
# working = True # False
# [plotting]
# library = matplotlib # plotly

View file

@ -23,9 +23,8 @@ def change_plotting_library(lib):
#===========================================================================
except (ImportError, NameError):
config.set('plotting', 'library', 'none')
raise
import warnings
#warnings.warn(ImportWarning("{} not available, install newest version of {} for plotting".format(lib, lib)))
warnings.warn(ImportWarning("{} not available, install newest version of {} for plotting".format(lib, lib)))
from ..util.config import config
lib = config.get('plotting', 'library')

View file

@ -12,8 +12,6 @@ except ImportError:
config = configparser.ConfigParser()
# This is the default configuration file that always needs to be present.
default_file = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'defaults.cfg'))
@ -23,10 +21,11 @@ local_file = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'in
# This specifies configurations specific to the user (it is found in the user home directory)
home = os.getenv('HOME') or os.getenv('USERPROFILE')
user_file = os.path.join(home,'.gpy_user.cfg')
user_file = os.path.join(home,'.config','gpy', 'user.cfg')
# Read in the given files.
config.readfp(open(default_file))
config.read([local_file, user_file])
if not config:
raise ValueError("No configuration file found at either " + user_file + " or " + local_file + " or " + default_file + ".")