Skip to content

Commit 2a98e81

Browse files
larsoneragramfort
authored andcommitted
MRG: Try envs (#4641)
* 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
1 parent 9137358 commit 2a98e81

21 files changed

+318
-188
lines changed

.travis.yml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ cache:
88
- $HOME/.ccache
99
env:
1010
# TRAVIS_PYTHON_VERSION is only needed for neo's setup.py
11-
global: PYTHON_VERSION=2.7 DISPLAY=:99.0 MNE_LOGGING_LEVEL=warning TEST_LOCATION=src
12-
PIP_DEPENDENCIES="codecov pytest-faulthandler" OPTION=""
11+
global: PYTHON_VERSION=3.6 DISPLAY=:99.0 MNE_LOGGING_LEVEL=warning TEST_LOCATION=src
12+
PIP_DEPENDENCIES="codecov pytest-faulthandler pytest-sugar" OPTION=""
1313
TRAVIS_PYTHON_VERSION=3.6
1414

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

24-
# Full (Linux, 2.7)
24+
# Linux
2525
- os: linux
2626
env: CONDA_ENVIRONMENT="environment.yml"
2727
SPLIT=0
@@ -37,42 +37,39 @@ matrix:
3737
env: CONDA_ENVIRONMENT="environment.yml"
3838
SPLIT=1
3939

40-
# Py3k + non-default stim channel
40+
# 2.7 + non-default stim channel
4141
- os: linux
42-
env: PYTHON_VERSION=3.6 TEST_LOCATION=install MNE_STIM_CHANNEL=STI101
43-
CONDA_DEPENDENCIES="numpy scipy matplotlib pandas scikit-learn h5py pillow statsmodels nose pytest pytest-cov"
44-
PIP_DEPENDENCIES="nitime joblib nibabel codecov pytest-sugar pytest-faulthandler"
42+
env: CONDA_ENVIRONMENT="environment2.yml" MNE_STIM_CHANNEL=STI101
4543
SPLIT=0
4644
- os: linux
47-
env: PYTHON_VERSION=3.6 TEST_LOCATION=install MNE_STIM_CHANNEL=STI101
48-
CONDA_DEPENDENCIES="numpy scipy matplotlib pandas scikit-learn h5py pillow statsmodels nose pytest pytest-cov"
49-
PIP_DEPENDENCIES="nitime joblib nibabel codecov pytest-sugar pytest-faulthandler"
45+
env: CONDA_ENVIRONMENT="environment2.yml" MNE_STIM_CHANNEL=STI101
5046
SPLIT=1
5147

52-
# Old dependencies
48+
# 2.7 Old dependencies
5349
- os: linux
54-
env: CONDA_DEPENDENCIES="numpy=1.8 scipy=0.12 matplotlib=1.3 pandas=0.12 scikit-learn=0.14 nose pytest pytest-cov"
55-
PIP_DEPENDENCIES="codecov pytest-sugar pytest-faulthandler"
50+
env: PYTHON_VERSION=2.7
51+
CONDA_DEPENDENCIES="numpy=1.8 scipy=0.12 matplotlib=1.3 pandas=0.12 scikit-learn=0.14 nose pytest pytest-cov"
5652
SPLIT=0
5753
- os: linux
58-
env: CONDA_DEPENDENCIES="numpy=1.8 scipy=0.12 matplotlib=1.3 pandas=0.12 scikit-learn=0.14 nose pytest pytest-cov"
59-
PIP_DEPENDENCIES="codecov pytest-sugar pytest-faulthandler"
54+
env: PYTHON_VERSION=2.7
55+
CONDA_DEPENDENCIES="numpy=1.8 scipy=0.12 matplotlib=1.3 pandas=0.12 scikit-learn=0.14 nose pytest pytest-cov"
6056
SPLIT=1
6157

6258
# Minimal
6359
- os: linux
6460
env: DEPS=minimial
6561
CONDA_DEPENDENCIES="numpy scipy matplotlib nose pytest pytest-cov"
66-
PIP_DEPENDENCIES="codecov faulthandler pytest-sugar pytest-faulthandler"
6762
SPLIT=0
6863
- os: linux
6964
env: DEPS=minimial
7065
CONDA_DEPENDENCIES="numpy scipy matplotlib nose pytest pytest-cov"
71-
PIP_DEPENDENCIES="codecov faulthandler pytest-sugar pytest-faulthandler"
7266
SPLIT=1
7367

7468
# Setup anaconda
7569
before_install:
70+
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
71+
/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;
72+
fi;
7673
- git clone https://github.com/astropy/ci-helpers.git
7774
- source ci-helpers/travis/setup_conda.sh
7875
- if [ ! -z $CONDA_ENVIRONMENT ]; then
@@ -92,9 +89,6 @@ before_install:
9289
fi;
9390
mne_surf2bem --version;
9491
fi;
95-
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
96-
/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;
97-
fi;
9892

9993
install:
10094
# Suppress the parallel outputs for logging cleanliness

doc/_static/copybutton.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// Copyright 2014 PSF. Licensed under the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
2+
// File originates from the cpython source found in Doc/tools/sphinxext/static/copybutton.js
3+
4+
$(document).ready(function() {
5+
/* Add a [>>>] button on the top-right corner of code samples to hide
6+
* the >>> and ... prompts and the output and thus make the code
7+
* copyable. */
8+
var div = $('.highlight-python .highlight,' +
9+
'.highlight-default .highlight,' +
10+
'.highlight-python3 .highlight')
11+
var pre = div.find('pre');
12+
13+
// get the styles from the current theme
14+
pre.parent().parent().css('position', 'relative');
15+
var hide_text = 'Hide the prompts and output';
16+
var show_text = 'Show the prompts and output';
17+
var border_width = pre.css('border-top-width');
18+
var border_style = pre.css('border-top-style');
19+
var border_color = pre.css('border-top-color');
20+
var button_styles = {
21+
'cursor':'pointer', 'position': 'absolute', 'top': '0', 'right': '0',
22+
'border-color': border_color, 'border-style': border_style,
23+
'border-width': border_width, 'color': border_color, 'text-size': '75%',
24+
'font-family': 'monospace', 'padding-left': '0.2em', 'padding-right': '0.2em',
25+
'border-radius': '0 3px 0 0'
26+
}
27+
28+
// create and add the button to all the code blocks that contain >>>
29+
div.each(function(index) {
30+
var jthis = $(this);
31+
if (jthis.find('.gp').length > 0) {
32+
var button = $('<span class="copybutton">&gt;&gt;&gt;</span>');
33+
button.css(button_styles)
34+
button.attr('title', hide_text);
35+
button.data('hidden', 'false');
36+
jthis.prepend(button);
37+
}
38+
// tracebacks (.gt) contain bare text elements that need to be
39+
// wrapped in a span to work with .nextUntil() (see later)
40+
jthis.find('pre:has(.gt)').contents().filter(function() {
41+
return ((this.nodeType == 3) && (this.data.trim().length > 0));
42+
}).wrap('<span>');
43+
});
44+
45+
// define the behavior of the button when it's clicked
46+
$('.copybutton').click(function(e){
47+
e.preventDefault();
48+
var button = $(this);
49+
if (button.data('hidden') === 'false') {
50+
// hide the code output
51+
button.parent().find('.go, .gp, .gt').hide();
52+
button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'hidden');
53+
button.css('text-decoration', 'line-through');
54+
button.attr('title', show_text);
55+
button.data('hidden', 'true');
56+
} else {
57+
// show the code output
58+
button.parent().find('.go, .gp, .gt').show();
59+
button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'visible');
60+
button.css('text-decoration', 'none');
61+
button.attr('title', hide_text);
62+
button.data('hidden', 'false');
63+
}
64+
});
65+
});
66+

doc/_templates/layout.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
{% block extrahead %}
44

5+
<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>
6+
57
{% if use_google_analytics|tobool %}
68
<script type="text/javascript">
79
var _gaq = _gaq || [];

doc/advanced_setup.rst

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,46 @@ Advanced setup and troubleshooting
1111
:local:
1212
:depth: 1
1313

14+
.. _installing_master:
15+
16+
Using the development version of MNE
17+
####################################
18+
19+
It is possible to update your version of MNE between releases for
20+
bugfixes or new features.
21+
22+
.. warning:: In between releases, function and class APIs can change without
23+
warning.
24+
25+
You can use ``pip`` for a one-time update:
26+
27+
.. code-block:: console
28+
29+
$ pip install --upgrade --no-deps git+https://github.com/mne-tools/mne-python.git
30+
31+
Or, if you prefer to be set up for frequent updates, you can use ``git`` directly:
32+
33+
.. code-block:: console
34+
35+
$ git clone git://github.com/mne-tools/mne-python.git
36+
$ cd mne-python
37+
$ python setup.py develop
38+
39+
A feature of ``python setup.py develop`` is that any changes made to
40+
the files (e.g., by updating to latest ``master``) will be reflected in
41+
``mne`` as soon as you restart your Python interpreter. So to update to
42+
the latest version of the ``master`` development branch, you can do:
43+
44+
.. code-block:: console
45+
46+
$ git pull origin master
47+
48+
and MNE will be updated to have the latest changes.
49+
50+
51+
If you plan to contribute to MNE, please continue reading how to
52+
:ref:`contribute_to_mne`.
53+
1454
.. _CUDA:
1555

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

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

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

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

65-
.. code-block:: bash
105+
.. code-block:: console
66106
67107
$ pytest mne/tests/test_filter.py
68108
69109
If ``MNE_USE_CUDA=true`` and all tests pass with none skipped, then
70110
MNE-Python CUDA support works.
71111

72-
IPython (and notebooks)
73-
#######################
112+
IPython / Jupyter notebooks
113+
###########################
74114

75-
In IPython, we strongly recommend using the Qt matplotlib backend for
115+
In Jupyter, we strongly recommend using the Qt matplotlib backend for
76116
fast and correct rendering:
77117

78-
.. code-block:: bash
118+
.. code-block:: console
79119
80120
$ ipython --matplotlib=qt
81121
@@ -116,5 +156,8 @@ the interpreter to use QtGui and QtCore from pyface::
116156

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

159+
To avoid Qt conflicts, you can also try using the ``wx`` backend via
160+
``conda install wxpython`` and ``ETS_TOOLKIT=wx``.
161+
119162
For more information, see
120163
http://docs.enthought.com/mayavi/mayavi/building_applications.html.

doc/conf.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,6 @@
304304
'doc_module': ('mne',),
305305
'reference_url': {
306306
'mne': None,
307-
'numpy': 'http://docs.scipy.org/doc/numpy',
308-
'scipy': 'http://docs.scipy.org/doc/scipy/reference',
309-
'matplotlib': 'http://matplotlib.org',
310-
'sklearn': 'http://scikit-learn.org/stable',
311-
'mayavi': 'http://docs.enthought.com/mayavi/mayavi',
312-
'nibabel': 'http://nipy.org/nibabel',
313-
'nilearn': 'http://nilearn.github.io',
314-
'surfer': 'https://pysurfer.github.io',
315307
},
316308
'examples_dirs': examples_dirs,
317309
'gallery_dirs': gallery_dirs,

0 commit comments

Comments
 (0)