Commit 6206b3b7 authored by Andreas Tille's avatar Andreas Tille
Browse files

New upstream version 0.17+dfsg

parent 4efa94e1
Loading
Loading
Loading
Loading

.circleci/config.yml

0 → 100644
+265 −0
Original line number Diff line number Diff line
# Tagging a commit with [circle front] will build the front page and perform test-doc.
# Tagging a commit with [circle full] will build everything.
version: 2
jobs:
    build:
      docker:
        # 3.6-jessie is too new for conda
        - image: circleci/python:3.6-jessie
      steps:
        # Get our data and merge with upstream
        - checkout
        - run: echo $(git log -1 --pretty=%B) | tee gitlog.txt
        - run: echo ${CI_PULL_REQUEST//*pull\//} | tee merge.txt
        - run:
           command: |
             if [[ $(cat merge.txt) != "" ]]; then
               echo "Merging $(cat merge.txt)";
               git remote add upstream git://github.com/mne-tools/mne-python.git
               git pull --ff-only upstream "refs/pull/$(cat merge.txt)/merge";
             fi

        # Load our data
        - restore_cache:
            keys:
              - data-cache-0
              - data-cache-1
              - data-cache-2
              - data-cache-3
              - data-cache-4
              - data-cache-5
              - data-cache-6
              - data-cache-7
              - data-cache-8
              - pip-cache

        # Spin up Xvfb
        - run: /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;
        - run: echo "export DISPLAY=:99" >> $BASH_ENV;
        - run: echo "export OPENBLAS_NUM_THREADS=4" >> $BASH_ENV;
        # Fix libgcc_s.so.1 pthread_cancel bug:
        # https://github.com/ContinuumIO/anaconda-issues/issues/9190#issuecomment-386508136
        # https://github.com/golemfactory/golem/issues/1019
        - run: sudo apt-get install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6 qt5-default
        # Get latest Anaconda running
        - run:
            command: |
              wget -q http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O ~/miniconda.sh;
              chmod +x ~/miniconda.sh;
              ~/miniconda.sh -b -p ~/miniconda;
              echo "export PATH=~/miniconda/bin:$PATH" >> $BASH_ENV;
        - run:
            command: |
              conda update --yes --quiet conda;
              conda env create --quiet -f environment.yml;
              source activate mne;
              conda install sphinx;
              pip install sphinx_fontawesome sphinx_bootstrap_theme "https://api.github.com/repos/sphinx-gallery/sphinx-gallery/zipball/master" memory_profiler
              pip uninstall --yes mne;
              echo "source activate mne" >> $BASH_ENV;
        - save_cache:
            key: pip-cache
            paths:
              - ~/.cache/pip
        # The conda-provided PyQt5 does not work on CircleCI for some reason,
        # possibly because the libGL expects a sufficiently modern libgcc
        # and conda rolls their own (libgcc-ng package).
        - run: conda remove --yes qt pyqt matplotlib sip libxcb icu vtk
        - run: pip uninstall --yes mayavi vtk
        - run: pip install vtk mayavi PyQt5 PyQt5-sip sip matplotlib
        - run: echo "export LD_PRELOAD=~/miniconda/envs/mne/lib/libgobject-2.0.so.0" >> $BASH_ENV
        - run: pip install --upgrade "https://api.github.com/repos/nipy/PySurfer/zipball/master"
        # Look at what we have and fail early if there is some library conflict
        - run: which python
        - run: python -c "import mne; mne.sys_info()"
        - run: LIBGL_DEBUG=verbose python -c "from mayavi import mlab; import matplotlib.pyplot as plt; mlab.figure(); plt.figure()"
        - run: python -c "import mne; mne.set_config('MNE_LOGGING_LEVEL', 'info')"
        - run: python -c "import mne; level = mne.get_config('MNE_LOGGING_LEVEL'); assert level.lower() == 'info', repr(level)"

        # Figure out if we should run a full, pattern, or noplot version
        - run: python setup.py develop
        - run: if ! git remote -v | grep upstream ; then git remote add upstream git://github.com/mne-tools/mne-python.git; fi
        - run: git fetch upstream
        - run: git branch -a
        - run: mkdir -p ~/mne_data
        - run:
            command: |
              touch pattern.txt;
              if [ "$CIRCLE_BRANCH" == "master" ] || [[ $(cat gitlog.txt) == *"[circle full]"* ]]; then
                echo html_dev > build.txt;
              elif [ "$CIRCLE_BRANCH" == "maint/0.17" ]; then
                echo html_stable > build.txt;
              else
                FNAMES=$(git diff --name-only $CIRCLE_BRANCH $(git merge-base $CIRCLE_BRANCH upstream/master));
                if [[ $(cat gitlog.txt) == *"[circle front]"* ]]; then
                  FNAMES="tutorials/plot_mne_dspm_source_localization.py tutorials/plot_receptive_field.py examples/connectivity/plot_mne_inverse_label_connectivity.py tutorials/plot_sensors_decoding.py tutorials/plot_stats_cluster_spatio_temporal.py tutorials/plot_visualize_evoked.py "${FNAMES};
                  python -c "import mne; print(mne.datasets.testing.data_path(update_path=True))";
                fi;
                echo FNAMES="$FNAMES";
                for FNAME in $FNAMES; do
                  if [[ `expr match $FNAME "\(tutorials\|examples\)/.*plot_.*\.py"` ]] ; then
                    echo "Checking example $FNAME ...";
                    PATTERN=`basename $FNAME`"\\|"$PATTERN;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*sample.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.sample.data_path(update_path=True))";
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*spm_face.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.spm_face.data_path(update_path=True))";
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*somato.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.somato.data_path(update_path=True))";
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*eegbci.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.eegbci.load_data(1, [6, 10, 14], update_path=True))";
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*hf_sef.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.hf_sef.data_path(update_path=True))";
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*brainstorm.*bst_auditory.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.brainstorm.bst_auditory.data_path(update_path=True))" --accept-brainstorm-license;
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*brainstorm.*bst_raw.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.brainstorm.bst_raw.data_path(update_path=True))" --accept-brainstorm-license;
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*brainstorm.*bst_phantom_ctf.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.brainstorm.bst_phantom_ctf.data_path(update_path=True))" --accept-brainstorm-license;
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*brainstorm.*bst_phantom_elekta.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.brainstorm.bst_phantom_elekta.data_path(update_path=True))" --accept-brainstorm-license;
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*megsim.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.megsim.load_data(condition='visual', data_format='single-trial', data_type='simulation', update_path=True))";
                      python -c "import mne; print(mne.datasets.megsim.load_data(condition='visual', data_format='raw', data_type='experimental', update_path=True))";
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*hcp_mmp_parcellation.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.sample.data_path(update_path=True))";
                      SUBJECTS_DIR=~/mne_data/MNE-sample-data/subjects python -c "import mne; print(mne.datasets.fetch_hcp_mmp_parcellation())" --accept-hcpmmp-license;
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*misc.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.misc.data_path(update_path=True))";
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*testing.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.testing.data_path(update_path=True))";
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*kiloword.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.kiloword.data_path(update_path=True))";
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*mtrf.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.mtrf.data_path(update_path=True))";
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*fieldtrip_cmc.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.fieldtrip_cmc.data_path(update_path=True))";
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*multimodal.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.multimodal.data_path(update_path=True))";
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*opm.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.opm.data_path(update_path=True))";
                    fi;
                    if [[ $(cat $FNAME | grep -x ".*datasets.*phantom_4dbti.*" | wc -l) -gt 0 ]]; then
                      python -c "import mne; print(mne.datasets.phantom_4dbti.data_path(update_path=True))";
                    fi;
                  fi;
                done;
                echo PATTERN="$PATTERN";
                if [[ $PATTERN ]]; then
                  PATTERN="\(${PATTERN::-2}\)";
                  echo html_dev-pattern > build.txt;
                else
                  echo html_dev-noplot > build.txt;
                fi;
              fi;
              echo "$PATTERN" > pattern.txt;
        - run: echo "PATTERN=$(cat pattern.txt)"
        - run: echo "BUILD=$(cat build.txt)"
        - run: ls -al ~/mne_data;
        - run:
            command: |
              if [[ $(cat build.txt) == "html_dev" ]] || [[ $(cat build.txt) == "html_stable" ]]; then
                SUBJECTS_DIR=~/mne_data/MNE-sample-data/subjects python -c "import mne; mne.datasets._download_all_example_data()";
              fi;
        - run: if [ ! -d ~/mne-tools.github.io ]; then git clone https://github.com/mne-tools/mne-tools.github.io.git ~/mne-tools.github.io --depth=1; fi;
        # Run doctest (if it's full or front) before building the docs
        - run:
            command: |
              if [[ $(cat gitlog.txt) == *"[circle front]"* ]] || [[ $(cat build.txt) == "html_dev" ]] || [[ $(cat build.txt) == "html_stable" ]]; then
                make test-doc;
              fi;
        # Build docs
        - run:
            command: |
              cd doc;
              PATTERN=$(cat ../pattern.txt) make $(cat ../build.txt);
        - run: python -c "import mne; level = mne.get_config('MNE_LOGGING_LEVEL'); assert level.lower() == 'info', repr(level)"

        - store_artifacts:
            path: doc/_build/html/
            destination: html

        # Keep these separate, maybe better in terms of size limitations (?)
        - save_cache:
            key: data-cache-0
            paths:
              - ~/.mne
              - ~/mne-tools.github.io
              - ~/mne_data/mTRF_1.5
        - save_cache:
            key: data-cache-1
            paths:
              - ~/mne_data/HF_SEF
              - ~/mne_data/MEGSIM
        - save_cache:
            key: data-cache-2
            paths:
              - ~/mne_data/MNE-brainstorm-data
              - ~/mne_data/MNE-eegbci-data
        - save_cache:
            key: data-cache-3
            paths:
              - ~/mne_data/MNE-fieldtrip_cmc-data
              - ~/mne_data/MNE-kiloword-data
        - save_cache:
            key: data-cache-4
            paths:
              - ~/mne_data/MNE-misc-data
              - ~/mne_data/MNE-multimodal-data
        - save_cache:
            key: data-cache-5
            paths:
              - ~/mne_data/MNE-OPM-data
              - ~/mne_data/MNE-phantom-4DBTi
        - save_cache:
            key: data-cache-6
            paths:
              - ~/mne_data/MNE-sample-data
              - ~/mne_data/MNE-somato-data
        - save_cache:
            key: data-cache-7
            paths:
              - ~/mne_data/MNE-spm-face
              - ~/mne_data/MNE-testing-ata
        - save_cache:
            key: data-cache-8
            paths:
              - ~/mne_data/MNE-visual_92_categories-data

        - deploy:
            name: Triage deployment
            command: |
              if [ "${CIRCLE_BRANCH}" == "master" ]; then
                echo "Deploying dev docs.";
                git config --global user.email "circle@mne.com";
                git config --global user.name "Circle Ci";
                pushd ~/mne-tools.github.io && git checkout master && git pull origin master && popd;
                pushd doc/_build && rm -Rf ~/mne-tools.github.io/dev && cp -a html ~/mne-tools.github.io/dev && popd;
                pushd ~/mne-tools.github.io && git add -A && git commit -m "CircleCI update of dev docs (${CIRCLE_BUILD_NUM})." && git push origin master && popd;
              elif [ "${CIRCLE_BRANCH}" == "maint/0.17" ]; then
                echo "Deploying stable docs.";
                git config --global user.email "circle@mne.com";
                git config --global user.name "Circle Ci";
                pushd ~/mne-tools.github.io && git checkout master && git pull origin master && popd;
                pushd doc/_build && rm -Rf ~/mne-tools.github.io/stable cp -a html_stable ~/mne-tools.github.io/stable && popd;
                pushd ~/mne-tools.github.io && git add -A && git commit -m "CircleCI update of stable docs (${CIRCLE_BUILD_NUM})." && git push origin master && popd;
              else
                echo "No deployment (build: ${CIRCLE_BRANCH}).";
              fi
+13 −0
Original line number Diff line number Diff line
# Contributing to MNE-Python

First off, thanks for taking the time to contribute!

The following is a quick summary to a set of guidelines for contributing to [MNE-Python](https://github.com/mne-python/mne-python) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.

## Code of Conduct

This project and everyone participating in it is governed by the [MNE-Python's Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [mne-conduct@googlegroups.com](mailto:mne-conduct@googlegroups.com).

## How to contribute

Before contributing make sure you are familiar with [our contributing guide](https://martinos.org/mne/contributing.html).
+5 −0
Original line number Diff line number Diff line
---
name: Blank issue
about: Create an issue without a template.

---
+50 −0
Original line number Diff line number Diff line
---
name: Bug report
about: Create a report to help us improve.

---

Detailed instructions on how to file a bug can be found in our [FAQ](https://martinos.org/mne/stable/faq.html#i-think-i-found-a-bug-what-do-i-do).

If your issue is a usage question, please consider asking on our [Gitter channel](https://gitter.im/mne-tools/mne-python) or on our [mailing list](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis) instead of opening an issue.


#### Describe the bug
Please provide a clear and concise description of the bug.


#### Steps and/or code to reproduce
Please provide a code snippet or [minimal working example (MWE)](https://en.wikipedia.org/wiki/Minimal_Working_Example)
to replicate your problem.

This MWE should be self-contained, which means that other MNE-Python contributors
should be able to copy and paste the provided snippet and replicate the bug.
If possible, use MNE-Python testing examples to reproduce the error. Otherwise,
provide a small and anonymized portion of your data required to reproduce the bug.

If the code is too long, feel free to put it in a [public gist](https://gist.github.com) and link
it in the issue.

Example:

```Python
import mne

fname = mne.datasets.sample.data_path() + '/MEG/sample/sample_audvis_raw.fif'
raw = mne.io.read_raw_fif(fname)
raw = mne.concatenate_raws([raw])
raw.save('test_raw.fif', overwrite=True)
raw_read = mne.io.read_raw_fif('test_raw.fif')  # this breaks
```


#### Expected results
Provide a clear and concise description of what you expected to happen.


#### Actual results
Please paste or specifically describe the actual output or traceback.


#### Additional information
Paste the output of `mne.sys_info()` here.
+22 −0
Original line number Diff line number Diff line
---
name: Feature request
about: Suggest an idea for this project.

---

If your issue is a usage question, please consider asking on our [Gitter channel](https://gitter.im/mne-tools/mne-python) or on our [mailing list](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis) instead of opening an issue.

#### Describe the problem
Please provide a clear and concise description of the problem.


#### Describe your solution
A clear and concise description of what you want to happen.


#### Describe possible alternatives
A clear and concise description of any alternative solutions or features you have considered.


#### Additional context
Add any other context or screenshots about the feature request here.
Loading