mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-18 13:55:14 +02:00
[config] default stub install verbose
This commit is contained in:
parent
3460b967a2
commit
096254a49c
4 changed files with 46 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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 + ".")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue