mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-21 14:05:14 +02:00
many dramatic cahnges. at least it import without error.
This commit is contained in:
parent
7812a7dc7d
commit
881800126f
2 changed files with 29 additions and 0 deletions
7
GPy/gpy_config.cfg
Normal file
7
GPy/gpy_config.cfg
Normal 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
22
GPy/util/config.py
Normal 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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue