diff --git a/.travis.yml b/.travis.yml index a866cb5a..4644dbf1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/GPy/plotting/__init__.py b/GPy/plotting/__init__.py index 7172543d..d89369ad 100644 --- a/GPy/plotting/__init__.py +++ b/GPy/plotting/__init__.py @@ -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") \ No newline at end of file + #sys.modules[__name__+'.matplot_dep'] = ImportWarning("Matplotlib not available, install newest version of Matplotlib for plotting") diff --git a/GPy/plotting/matplot_dep/__init__.py b/GPy/plotting/matplot_dep/__init__.py index a60b52c2..a72e448f 100644 --- a/GPy/plotting/matplot_dep/__init__.py +++ b/GPy/plotting/matplot_dep/__init__.py @@ -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 \ No newline at end of file +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 diff --git a/GPy/plotting/matplot_dep/base_plots.py b/GPy/plotting/matplot_dep/base_plots.py index 45597628..aefb3e8d 100644 --- a/GPy/plotting/matplot_dep/base_plots.py +++ b/GPy/plotting/matplot_dep/base_plots.py @@ -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: diff --git a/GPy/testing/rv_transformation_tests.py b/GPy/testing/rv_transformation_tests.py index 44d8710d..18dccd36 100644 --- a/GPy/testing/rv_transformation_tests.py +++ b/GPy/testing/rv_transformation_tests.py @@ -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))