We are open to many types of contributions, from bugfixes to functionality
enhancements. mne-python is meant to be maintained by a community of labs,
and as such, we seek enhancements that will likely benefit a large proportion
of the users who use the package.

Before starting new code, we highly recommend opening an issue on
mne-python GitHub to discuss potential changes. Getting on the same
page as the maintainers about changes or enhancements before too much
coding is done saves everyone time and effort!

Standard python style guidelines set by pep8 and pyflakes are followed
with very few exceptions. We recommend using an editor that calls out
style violations automatcally, such as Spyder. From the MNE code root, you
can check for violations using flake8 with:

All changes to the codebase must be properly documented.
To ensure that documentation is rendered correctly, the best bet is to
follow the existing examples for class and function docstrings,
and examples and tutorials.

Documentation is automatically built remotely during pull requests. If
you want to also test documentation locally, you will need to install
sphinxsphinx-gallerysphinx_bootstrap_themenumpydoc, and then within
the mne/doc directory do:

$ make html_dev-noplot

If you are working on examples or tutorials, you can build specific examples
with:

If you need to deprecate a function or a class, use the @deprecated decorator:

frommne.utilsimportdeprecated@deprecated('my_function will be deprecated in 0.XX, please use my_new_function instead.')defmy_function():return'foo'

If you need to deprecate a parameter, use the mne warning function.
For example to rename a parameter from old_param to new_param you can
use something like this:

frommne.utilsimportwarndefmy_function(new_param,old_param=None):ifold_paramisnotNone:warn('old_param is deprecated and will be replaced by new_param in 0.XX.',DeprecationWarning)new_param=old_param# Do what you have to do with new_paramreturn'foo'