diff --git a/GPy/core/gp_base.py b/GPy/core/gp_base.py index cb968520..548e2924 100644 --- a/GPy/core/gp_base.py +++ b/GPy/core/gp_base.py @@ -14,8 +14,11 @@ class GPBase(Model): Here we define some functions that are use """ def __init__(self, X, likelihood, kernel, normalize_X=False): + if len(X.shape)==1: + X = X.reshape(-1,1) + warning.warn("One dimension output (N,) being reshaped to (N,1)") self.X = X - assert len(self.X.shape) == 2 + assert len(self.X.shape) == 2, "too many dimensions for X input" self.num_data, self.input_dim = self.X.shape assert isinstance(kernel, kern.kern) self.kern = kernel diff --git a/GPy/util/config.py b/GPy/util/config.py index d2ed7543..02796e0b 100644 --- a/GPy/util/config.py +++ b/GPy/util/config.py @@ -5,13 +5,18 @@ import ConfigParser import os config = ConfigParser.ConfigParser() -user_file = os.path.join(os.getenv('HOME'),'.gpy_config.cfg') -default_file = os.path.join('..','gpy_config.cfg') +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) -else: +elif os.path.isfile(default_file): # 2. if not, use the default one - path = os.path.dirname(__file__) - config.read(os.path.join(path,default_file)) + config.read(default_file) +else: + #3. panic + raise ValueError, "no configuration file found" diff --git a/MANIFEST.in b/MANIFEST.in index c89284cd..8d5b2304 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,3 +2,5 @@ include *.txt recursive-include doc *.txt include *.md recursive-include doc *.md +include *.cfg +recursive-include doc *.cfg