Skip to content

Commit

Permalink
MRG: Try envs (mne-tools#4641)
Browse files Browse the repository at this point in the history
* ENH: Try envs

* FIX: Fix AppVeyor

* FIX: Fix GUIs

* w

* FIX: Skip problematic tests for OSX

* FIX: Put PySurfer back

* FIX: Fix doc

* FIX: Switch to 3.6

* FIX: Fix Travis

* STY: Fix naming [ci skip]

* FIX: Fix instructions
  • Loading branch information
larsoner authored and agramfort committed Oct 9, 2017
1 parent 9137358 commit 2a98e81
Show file tree
Hide file tree
Showing 21 changed files with 318 additions and 188 deletions.
34 changes: 14 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ cache:
- $HOME/.ccache
env:
# TRAVIS_PYTHON_VERSION is only needed for neo's setup.py
global: PYTHON_VERSION=2.7 DISPLAY=:99.0 MNE_LOGGING_LEVEL=warning TEST_LOCATION=src
PIP_DEPENDENCIES="codecov pytest-faulthandler" OPTION=""
global: PYTHON_VERSION=3.6 DISPLAY=:99.0 MNE_LOGGING_LEVEL=warning TEST_LOCATION=src
PIP_DEPENDENCIES="codecov pytest-faulthandler pytest-sugar" OPTION=""
TRAVIS_PYTHON_VERSION=3.6

matrix:
Expand All @@ -21,7 +21,7 @@ matrix:
PIP_DEPENDENCIES="flake8 numpydoc codespell git+git://github.com/PyCQA/pydocstyle.git codecov check-manifest pytest-sugar"
OPTION="--doctest-ignore-import-errors"

# Full (Linux, 2.7)
# Linux
- os: linux
env: CONDA_ENVIRONMENT="environment.yml"
SPLIT=0
Expand All @@ -37,42 +37,39 @@ matrix:
env: CONDA_ENVIRONMENT="environment.yml"
SPLIT=1

# Py3k + non-default stim channel
# 2.7 + non-default stim channel
- os: linux
env: PYTHON_VERSION=3.6 TEST_LOCATION=install MNE_STIM_CHANNEL=STI101
CONDA_DEPENDENCIES="numpy scipy matplotlib pandas scikit-learn h5py pillow statsmodels nose pytest pytest-cov"
PIP_DEPENDENCIES="nitime joblib nibabel codecov pytest-sugar pytest-faulthandler"
env: CONDA_ENVIRONMENT="environment2.yml" MNE_STIM_CHANNEL=STI101
SPLIT=0
- os: linux
env: PYTHON_VERSION=3.6 TEST_LOCATION=install MNE_STIM_CHANNEL=STI101
CONDA_DEPENDENCIES="numpy scipy matplotlib pandas scikit-learn h5py pillow statsmodels nose pytest pytest-cov"
PIP_DEPENDENCIES="nitime joblib nibabel codecov pytest-sugar pytest-faulthandler"
env: CONDA_ENVIRONMENT="environment2.yml" MNE_STIM_CHANNEL=STI101
SPLIT=1

# Old dependencies
# 2.7 Old dependencies
- os: linux
env: CONDA_DEPENDENCIES="numpy=1.8 scipy=0.12 matplotlib=1.3 pandas=0.12 scikit-learn=0.14 nose pytest pytest-cov"
PIP_DEPENDENCIES="codecov pytest-sugar pytest-faulthandler"
env: PYTHON_VERSION=2.7
CONDA_DEPENDENCIES="numpy=1.8 scipy=0.12 matplotlib=1.3 pandas=0.12 scikit-learn=0.14 nose pytest pytest-cov"
SPLIT=0
- os: linux
env: CONDA_DEPENDENCIES="numpy=1.8 scipy=0.12 matplotlib=1.3 pandas=0.12 scikit-learn=0.14 nose pytest pytest-cov"
PIP_DEPENDENCIES="codecov pytest-sugar pytest-faulthandler"
env: PYTHON_VERSION=2.7
CONDA_DEPENDENCIES="numpy=1.8 scipy=0.12 matplotlib=1.3 pandas=0.12 scikit-learn=0.14 nose pytest pytest-cov"
SPLIT=1

# Minimal
- os: linux
env: DEPS=minimial
CONDA_DEPENDENCIES="numpy scipy matplotlib nose pytest pytest-cov"
PIP_DEPENDENCIES="codecov faulthandler pytest-sugar pytest-faulthandler"
SPLIT=0
- os: linux
env: DEPS=minimial
CONDA_DEPENDENCIES="numpy scipy matplotlib nose pytest pytest-cov"
PIP_DEPENDENCIES="codecov faulthandler pytest-sugar pytest-faulthandler"
SPLIT=1

# Setup anaconda
before_install:
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset;
fi;
- git clone https://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.sh
- if [ ! -z $CONDA_ENVIRONMENT ]; then
Expand All @@ -92,9 +89,6 @@ before_install:
fi;
mne_surf2bem --version;
fi;
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset;
fi;

install:
# Suppress the parallel outputs for logging cleanliness
Expand Down
66 changes: 66 additions & 0 deletions doc/_static/copybutton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Copyright 2014 PSF. Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
// File originates from the cpython source found in Doc/tools/sphinxext/static/copybutton.js

$(document).ready(function() {
/* Add a [>>>] button on the top-right corner of code samples to hide
* the >>> and ... prompts and the output and thus make the code
* copyable. */
var div = $('.highlight-python .highlight,' +
'.highlight-default .highlight,' +
'.highlight-python3 .highlight')
var pre = div.find('pre');

// get the styles from the current theme
pre.parent().parent().css('position', 'relative');
var hide_text = 'Hide the prompts and output';
var show_text = 'Show the prompts and output';
var border_width = pre.css('border-top-width');
var border_style = pre.css('border-top-style');
var border_color = pre.css('border-top-color');
var button_styles = {
'cursor':'pointer', 'position': 'absolute', 'top': '0', 'right': '0',
'border-color': border_color, 'border-style': border_style,
'border-width': border_width, 'color': border_color, 'text-size': '75%',
'font-family': 'monospace', 'padding-left': '0.2em', 'padding-right': '0.2em',
'border-radius': '0 3px 0 0'
}

// create and add the button to all the code blocks that contain >>>
div.each(function(index) {
var jthis = $(this);
if (jthis.find('.gp').length > 0) {
var button = $('<span class="copybutton">&gt;&gt;&gt;</span>');
button.css(button_styles)
button.attr('title', hide_text);
button.data('hidden', 'false');
jthis.prepend(button);
}
// tracebacks (.gt) contain bare text elements that need to be
// wrapped in a span to work with .nextUntil() (see later)
jthis.find('pre:has(.gt)').contents().filter(function() {
return ((this.nodeType == 3) && (this.data.trim().length > 0));
}).wrap('<span>');
});

// define the behavior of the button when it's clicked
$('.copybutton').click(function(e){
e.preventDefault();
var button = $(this);
if (button.data('hidden') === 'false') {
// hide the code output
button.parent().find('.go, .gp, .gt').hide();
button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'hidden');
button.css('text-decoration', 'line-through');
button.attr('title', show_text);
button.data('hidden', 'true');
} else {
// show the code output
button.parent().find('.go, .gp, .gt').show();
button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'visible');
button.css('text-decoration', 'none');
button.attr('title', hide_text);
button.data('hidden', 'false');
}
});
});

2 changes: 2 additions & 0 deletions doc/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

{% block extrahead %}

<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>

{% if use_google_analytics|tobool %}
<script type="text/javascript">
var _gaq = _gaq || [];
Expand Down
57 changes: 50 additions & 7 deletions doc/advanced_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,46 @@ Advanced setup and troubleshooting
:local:
:depth: 1

.. _installing_master:

Using the development version of MNE
####################################

It is possible to update your version of MNE between releases for
bugfixes or new features.

.. warning:: In between releases, function and class APIs can change without
warning.

You can use ``pip`` for a one-time update:

.. code-block:: console
$ pip install --upgrade --no-deps git+https://github.com/mne-tools/mne-python.git
Or, if you prefer to be set up for frequent updates, you can use ``git`` directly:

.. code-block:: console
$ git clone git://github.com/mne-tools/mne-python.git
$ cd mne-python
$ python setup.py develop
A feature of ``python setup.py develop`` is that any changes made to
the files (e.g., by updating to latest ``master``) will be reflected in
``mne`` as soon as you restart your Python interpreter. So to update to
the latest version of the ``master`` development branch, you can do:

.. code-block:: console
$ git pull origin master

and MNE will be updated to have the latest changes.


If you plan to contribute to MNE, please continue reading how to
:ref:`contribute_to_mne`.

.. _CUDA:

CUDA
Expand All @@ -28,7 +68,7 @@ If you want to use NVIDIA CUDA, you should install:
For example, on Ubuntu 15.10, a combination of system packages and ``git``
packages can be used to install the CUDA stack:

.. code-block:: bash
.. code-block:: console
# install system packages for CUDA
$ sudo apt-get install nvidia-cuda-dev nvidia-modprobe
Expand All @@ -49,7 +89,7 @@ To initialize mne-python cuda support, after installing these dependencies
and running their associated unit tests (to ensure your installation is correct)
you can run:

.. code-block:: bash
.. code-block:: console
$ MNE_USE_CUDA=true MNE_LOGGING_LEVEL=info python -c "import mne; mne.cuda.init_cuda()"
Enabling CUDA with 1.55 GB available memory
Expand All @@ -62,20 +102,20 @@ initialized on startup, you can do::

You can test if MNE CUDA support is working by running the associated test:

.. code-block:: bash
.. code-block:: console
$ pytest mne/tests/test_filter.py
If ``MNE_USE_CUDA=true`` and all tests pass with none skipped, then
MNE-Python CUDA support works.

IPython (and notebooks)
#######################
IPython / Jupyter notebooks
###########################

In IPython, we strongly recommend using the Qt matplotlib backend for
In Jupyter, we strongly recommend using the Qt matplotlib backend for
fast and correct rendering:

.. code-block:: bash
.. code-block:: console
$ ipython --matplotlib=qt
Expand Down Expand Up @@ -116,5 +156,8 @@ the interpreter to use QtGui and QtCore from pyface::

This line should be added before any imports from mne-python.

To avoid Qt conflicts, you can also try using the ``wx`` backend via
``conda install wxpython`` and ``ETS_TOOLKIT=wx``.

For more information, see
http://docs.enthought.com/mayavi/mayavi/building_applications.html.
8 changes: 0 additions & 8 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,6 @@
'doc_module': ('mne',),
'reference_url': {
'mne': None,
'numpy': 'http://docs.scipy.org/doc/numpy',
'scipy': 'http://docs.scipy.org/doc/scipy/reference',
'matplotlib': 'http://matplotlib.org',
'sklearn': 'http://scikit-learn.org/stable',
'mayavi': 'http://docs.enthought.com/mayavi/mayavi',
'nibabel': 'http://nipy.org/nibabel',
'nilearn': 'http://nilearn.github.io',
'surfer': 'https://pysurfer.github.io',
},
'examples_dirs': examples_dirs,
'gallery_dirs': gallery_dirs,
Expand Down
Loading

0 comments on commit 2a98e81

Please sign in to comment.