mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-08 15:05:15 +02:00
[testing] travis
This commit is contained in:
commit
00e1125d4b
7 changed files with 38 additions and 17 deletions
|
|
@ -39,6 +39,10 @@ script:
|
|||
|
||||
after_success:
|
||||
- codecov
|
||||
- conda install sphinx
|
||||
- cd doc
|
||||
- make html
|
||||
- cd ../
|
||||
|
||||
deploy:
|
||||
provider: pypi
|
||||
|
|
@ -48,4 +52,4 @@ deploy:
|
|||
on:
|
||||
plot_density
|
||||
server: https://testpypi.python.org/pypi
|
||||
distributions: "bdist_wheel sdist"
|
||||
distributions: "bdist_wheel sdist"
|
||||
|
|
|
|||
|
|
@ -43,6 +43,20 @@ def load(file_or_path):
|
|||
:param file_name: path/to/file.pickle
|
||||
"""
|
||||
try:
|
||||
unicode = unicode
|
||||
except NameError:
|
||||
# 'unicode' is undefined, must be Python 3
|
||||
str = str
|
||||
unicode = str
|
||||
bytes = bytes
|
||||
basestring = (str,bytes)
|
||||
else:
|
||||
# 'unicode' exists, must be Python 2
|
||||
str = str
|
||||
unicode = unicode
|
||||
bytes = str
|
||||
basestring = basestring
|
||||
try:
|
||||
import cPickle as pickle
|
||||
if isinstance(file_or_path, basestring):
|
||||
with open(file_or_path, 'rb') as f:
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class MiscTests(unittest.TestCase):
|
|||
Y = self.Y
|
||||
mu, std = Y.mean(0), Y.std(0)
|
||||
m = GPy.models.GPRegression(self.X, Y, kernel=k, normalizer=True)
|
||||
m.optimize()
|
||||
m.optimize(messages=True)
|
||||
assert(m.checkgrad())
|
||||
k = GPy.kern.RBF(1)
|
||||
m2 = GPy.models.GPRegression(self.X, (Y-mu)/std, kernel=k, normalizer=False)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ from GPy.core.parameterization.variational import NormalPosterior
|
|||
from GPy.models.gp_regression import GPRegression
|
||||
from functools import reduce
|
||||
from GPy.util.caching import Cacher
|
||||
import GPy
|
||||
from pickle import PicklingError
|
||||
|
||||
def toy_model():
|
||||
|
|
@ -60,13 +61,15 @@ class Test(ListDictTestCase):
|
|||
pio2 = pickle.load(f)
|
||||
self.assertListDictEquals(pio._properties, pio2._properties)
|
||||
|
||||
with tempfile.TemporaryFile('w+b') as f:
|
||||
pickle.dump(piov, f)
|
||||
f.seek(0)
|
||||
pio2 = pickle.load(f)
|
||||
#py3 fix
|
||||
#self.assertListDictEquals(dict(piov.items()), dict(pio2.iteritems()))
|
||||
self.assertListDictEquals(dict(piov.items()), dict(pio2.items()))
|
||||
f = tempfile.TemporaryFile('w+b')
|
||||
pickle.dump(piov, f)
|
||||
f.seek(0)
|
||||
pio2 = GPy.load(f)
|
||||
f.close()
|
||||
|
||||
#py3 fix
|
||||
#self.assertListDictEquals(dict(piov.items()), dict(pio2.iteritems()))
|
||||
self.assertListDictEquals(dict(piov.items()), dict(pio2.items()))
|
||||
|
||||
def test_param(self):
|
||||
param = Param('test', np.arange(4*2).reshape(4,2))
|
||||
|
|
|
|||
|
|
@ -101,7 +101,9 @@ def test_kernel():
|
|||
matplotlib.rcParams[u'text.usetex'] = False
|
||||
k = GPy.kern.RBF(5, ARD=True) + GPy.kern.Linear(3, active_dims=[0,2,4], ARD=True) + GPy.kern.Bias(2)
|
||||
k.randomize()
|
||||
k.plot_ARD(legend=True)
|
||||
k2 = GPy.kern.RBF(5, ARD=True) + GPy.kern.Linear(3, active_dims=[0,2,4], ARD=True) + GPy.kern.Bias(2) + GPy.kern.White(4)
|
||||
k2[:-1] = k[:]
|
||||
k2.plot_ARD([k2.white.name], legend=True)
|
||||
for do_test in _image_comparison(
|
||||
baseline_images=['kern_{}'.format(sub) for sub in ["ARD",]],
|
||||
extensions=extensions):
|
||||
|
|
|
|||
|
|
@ -8,10 +8,5 @@ commit = True
|
|||
[bdist_wheel]
|
||||
universal = 1
|
||||
|
||||
[build_sphinx]
|
||||
source-dir = doc/source
|
||||
build-dir = doc/build
|
||||
all_files = 1
|
||||
|
||||
[upload_sphinx]
|
||||
[upload_docs]
|
||||
upload-dir = doc/build/html
|
||||
5
setup.py
5
setup.py
|
|
@ -145,7 +145,10 @@ setup(name = 'GPy',
|
|||
'Operating System :: Microsoft :: Windows',
|
||||
'Operating System :: POSIX :: Linux',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Topic :: Scientific/Engineering :: Artificial Intelligence']
|
||||
'Programming Language :: Python :: 3.3',
|
||||
'Programming Language :: Python :: 3.4',
|
||||
'Programming Language :: Python :: 3.5',
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue