Skip to content

Latest commit

 

History

History
104 lines (58 loc) · 3.06 KB

CONTRIBUTING.md

File metadata and controls

104 lines (58 loc) · 3.06 KB

Contributions

Contributions are welcome in the form of pull requests. We heavily rely on the contribution guides of MNE-Python

Once the implementation of a piece of functionality is considered to be bug free and properly documented (both API docs and an example script), it can be incorporated into the main branch.

To help developing mne-connectivity, you will need a few adjustments to your installation as shown below.

Running tests

(Optional) Install development version of MNE-Python

If you want to run the tests with a development version of MNE-Python, you can install it by running

$ pip install -U https://github.com/mne-tools/mne-python/archive/main.zip

Install development version of MNE-Connectivity

First, you should fork the mne-connectivity repository. Then, clone the fork and install it in "editable" mode.

$ git clone https://github.com/<your-GitHub-username>/mne-connectivity
$ pip install -e ./mne-connectivity

Install Python packages required to run tests

Install the following packages for testing purposes, plus all optional MNE-connectivity dependencies to ensure you will be able to run all tests.

$ pip install .[test]

Invoke pytest

Now you can finally run the tests by running pytest in the mne-connectivity directory.

$ cd mne-connectivity
$ pytest

Building the documentation

The documentation can be built using sphinx. For that, please additionally install the following:

$ pip install .[doc]

To build the documentation locally, one can run:

$ cd doc/
$ make html

or

$ make html-noplot

if you don't want to run the examples to build the documentation. This will result in a faster build but produce no plots in the examples.

Issues with Memory Usage

All documentation examples are built on a CI pipeline that occurs online for free. For example, our docs are built with circleCI perhaps. This limits the ability for us to run large data examples that have a lot of RAM usage. For this reason, many times we crop, downsample, or limit the analysis in some way to reduce RAM usage.

Some good tools for profiling memory are mprof. For example, one can memory profile a specific example, such as:

mprof run examples/connectivity_classes.py

Then one could plot the memory usage:

mprof plot

Making a Release

  1. Ctrl+f and replace all version indicators with the new version. For example,

0.5.0dev0 -> 0.5.0

  1. Write release notes in whats_new.rst

  2. Build package locally and test

    python -m build

  3. Upload to Test PyPi

    twine upload dist/* --repository-url https://test.pypi.org/legacy/ --repository mne-connectivity

  4. Build docs locally

    make -C build-doc

  5. Push docs under doc/_build/html/ to the stable/ folder in gh-pages branch

  6. Make release to PyPi

    twine upload dist/*

or if you have two-factor authentication enabled: https://pypi.org/help/#apitoken

twine upload dist/* --repository mne-connectivity