Merge pull request #246 from SheffieldML/travis2

Dapid's travis changes
This commit is contained in:
Max Zwiessele 2015-09-12 14:52:56 +01:00
commit 2123079596
5 changed files with 54 additions and 46 deletions

View file

@ -1,27 +1,41 @@
language: python
python:
- "2.7"
sudo: false
os:
- linux
# - osx
language: python
#addons:
# apt:
# packages:
# - gfortran
# - libatlas-dev
# - libatlas-base-dev
# - liblapack-dev
python:
- 2.7
- 3.3
- 3.4
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
before_install:
#Install a mini version of anaconda such that we can easily install our dependencies
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=/home/travis/miniconda/bin:$PATH
- conda update --yes conda
# Workaround for a permissions issue with Travis virtual machine images
# that breaks Python's multiprocessing:
# https://github.com/travis-ci/travis-cookbooks/issues/155
- sudo rm -rf /dev/shm
- sudo ln -s /run/shm /dev/shm
# - conda update --yes conda
install:
- conda install --yes python=$TRAVIS_PYTHON_VERSION atlas numpy=1.9 scipy=0.16 matplotlib nose sphinx pip nose
#- pip install .
- python setup.py build_ext --inplace
#--use-mirrors
#
# command to run tests, e.g. python setup.py test
script:
- nosetests GPy/testing
- conda install --yes python=$TRAVIS_PYTHON_VERSION numpy=1.9 scipy=0.16 nose pip six
- pip install .
script:
- cd $HOME
- mkdir empty
- cd empty
- nosetests GPy.testing
cache:
directories:
- $HOME/.cache/pip

View file

@ -2,10 +2,11 @@
# Licensed under the BSD 3-clause license (see LICENSE.txt)
try:
import matplotlib
from . import matplot_dep
except (ImportError, NameError):
# Matplotlib not available
import warnings
warnings.warn(ImportWarning("Matplotlib not available, install newest version of Matplotlib for plotting"))
#sys.modules['matplotlib'] =
#sys.modules[__name__+'.matplot_dep'] = ImportWarning("Matplotlib not available, install newest version of Matplotlib for plotting")
#sys.modules[__name__+'.matplot_dep'] = ImportWarning("Matplotlib not available, install newest version of Matplotlib for plotting")

View file

@ -1,18 +1,18 @@
# Copyright (c) 2014, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import base_plots
import models_plots
import priors_plots
import variational_plots
import kernel_plots
import dim_reduction_plots
import mapping_plots
import Tango
import visualize
import latent_space_visualizations
import netpbmfile
import inference_plots
import maps
import img_plots
from ssgplvm import SSGPLVM_plot
from . import base_plots
from . import models_plots
from . import priors_plots
from . import variational_plots
from . import kernel_plots
from . import dim_reduction_plots
from . import mapping_plots
from . import Tango
from . import visualize
from . import latent_space_visualizations
from . import netpbmfile
from . import inference_plots
from . import maps
from . import img_plots
from .ssgplvm import SSGPLVM_plot

View file

@ -1,13 +1,6 @@
# #Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
try:
#import Tango
from matplotlib import pyplot as pb
except:
pass
import numpy as np
from matplotlib import pyplot as pb
def ax_default(fignum, ax):
if ax is None:

View file

@ -34,7 +34,7 @@ class RVTransformationTestCase(unittest.TestCase):
# The PDF of the transformed variables
p_phi = lambda phi : np.exp(-m._objective_grads(phi)[0])
# To the empirical PDF of:
theta_s = prior.rvs(100000)
theta_s = prior.rvs(1e6)
phi_s = trans.finv(theta_s)
# which is essentially a kernel density estimation
kde = st.gaussian_kde(phi_s)
@ -56,7 +56,7 @@ class RVTransformationTestCase(unittest.TestCase):
# The following test cannot be very accurate
self.assertTrue(np.linalg.norm(pdf_phi - kde(phi)) / np.linalg.norm(kde(phi)) <= 1e-1)
# Check the gradients at a few random points
for i in range(10):
for i in range(5):
m.theta = theta_s[i]
self.assertTrue(m.checkgrad(verbose=True))