many dramatic cahnges. at least it import without error.

This commit is contained in:
James Hensman 2013-12-05 13:49:38 -05:00
parent 7812a7dc7d
commit 881800126f
2 changed files with 29 additions and 0 deletions

7
GPy/gpy_config.cfg Normal file
View file

@ -0,0 +1,7 @@
# This is the configuration file for GPy
[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 this option.
openmp=False

22
GPy/util/config.py Normal file
View file

@ -0,0 +1,22 @@
#
# This loads the configuration
#
import ConfigParser
import os
config = ConfigParser.ConfigParser()
home = os.getenv('HOME') or os.getenv('USERPROFILE')
user_file = os.path.join(home,'.gpy_config.cfg')
default_file = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'gpy_config.cfg'))
print user_file, os.path.isfile(user_file)
print default_file, os.path.isfile(default_file)
# 1. check if the user has a ~/.gpy_config.cfg
if os.path.isfile(user_file):
config.read(user_file)
elif os.path.isfile(default_file):
# 2. if not, use the default one
config.read(default_file)
else:
#3. panic
raise ValueError, "no configuration file found"