Yesterday, I gave a workshop for Cutting Gardens tutors on how to teach MNE-Python. It was my first time teaching such a “meta workshop” - and below I am sharing some of the tips and thoughts I came up with during preparation. Part of it will be MNE-Python-specific, some of it should apply to any software workshop.

What should happen before the tutorial takes place?

There is a few key points that should happen before the tutorial takes place:

  1. preparation and sharing of the teaching material
  2. sharing of the installation information
  3. sharing of the data set
  4. participants should check their installations

I will explain those points in more detail below!

The teaching material

For teaching data analysis with MNE-Python, I like to use Jupyter Notebooks. They are easy to share, can feature easy-to-read text and more alongside the code, and they can be shared with or without the generated output. They can also easily be executed cell by cell, which makes them easier to manage in a classroom situation than plain Python files.
I usually go through the code together with the participants (executing the cells one by one) and explain what the code is doing. I sprinkle in some exercises that the students then have time for to solve - and we discuss the solutions together in the plenum.
Over the years, I have learned that you always need less material than you think you do - sometimes when I am unsure, I have “bonus material” prepared that we can go over in case we finish ahead of time.
Here is an example of a Notebook I have used for teaching at Practical MEEG 2022.

Where should you get started?

Supposedly, you don’t want to start from scratch - no need to reinvent the wheel! There is plenty of available material out there, especially for standard analyses.

MNE-Python features many tutorials and examples for anything from how to read in your data to machine learning and beyond.
Tutorials are very verbose - if you use them for teaching, you might want to shorten some of the text. Examples are less detailed - so you could add some notes here and there. All of them are downloadable as Jupyter Notebooks - and the data sets they use can all be downloaded from within MNE-Python. (Tip! Make sure your participants download the data sets before the start of the workshop. Especially via slower connections, some of the data sets might take a while to download.)

There is also other open source teaching material out there, one example is the material from Pratical MEEG 2022, which is available via Zenodo as well as my Github repo. For this, you need to download the data as well, the Multimodal Faces data set from Wakeman and Henson.

How do you choose which tutorial to run?

Maybe, you got asked to give a tutorial for a specific topic - or maybe, you are organizing everything yourself and have to choose what to teach. In that case, there is a few things you can consider: who are your participants and what do they know already? And, logically, what do you know already?
For some analyses, you might have to consider if you can find a suitable data set that you can share.
Another factor is how much time you have for teaching: in my experience, most topics (e.g., hands-on “beamformer analysis” or “forward modelling”) take around 1.5 to 2 hours for hands-on teaching (excluding a formal lecture on the topic). Full “from preprocessing to group statistics” workshops typically take 3 to 5 days (then including plenary lectures and hands-on sessions).
I like to clearly state learning objectives for sessions - both for my own sake as well as for the participants’ orientation.

Preparation: Sharing the material and setup

It’s important to share everything ahead of time to ensure a smooth start of the tutorial itself. That includes the following points:

  1. Making sure the participants know how to download the material (Notebooks, data sets, other resources)
  2. Share an installation guide for the software and state which version the material is tested on (make sure you indeed test your material in a fresh installation of that version!). MNE-Python has installation guides that you can link.
  3. Ask the participants to check their installation. You can share a Notebook for that with guidelines. If you use one of MNE-Python’s example data sets, you can also trigger the download within this file. Here a snippet to illustrate the rationale of testing the installation:
# Let's check if MNE-Python is installed - this should not return an error:
import mne

# Let's also see if the right version is installed. This should return 1.2.2:
mne.__version__

# The following line will download the data set in case you have not 
# downloaded it before:
mne.datasets.sample.data_path()

You can find a full example here.

Some tips for the actual teaching

Everybody has their own teaching style of course, but here are a few things that I find important or that made it easier for me to teach:

  1. Team up! If you can, have a few tutors helping you out. They can help participants that get stuck while you can continue engaging everyone else.
  2. Offer different perspectives and explanations for key concepts: it might feel odd at first to repeat the same thing a few different ways (personally, I like to work with metaphors), but I have gotten the feedback that this can help participants to understand things better. It can also help to ask one of the participants to explain a concept if you feel that your explanation does not reach everyone!
  3. Explain the rationale of the code: Take the time to explain parameter choices or lines of code that do multiple things at once. You can also show alternative ways to do things (e.g., for-loop versus list comprehension).
  4. Stop frequently and ask if there is questions. I also try to remember to ask the tutors if they came across questions that might be interesting for everyone.
  5. Try and avoid exclusionary language. To me, this also includes things like “now you just do this” and “it is easy to now …”. It’s an effort to eliminate this from our vocabulary, but I believe it can discourage people whom might not find it “easy to now …”. I also try to remember to check my teaching material for such phrasing. - Work in progress!
  6. Practice being aware of our implicit biases and act to correct them.

Some of the excellent questions that got asked during the workshop

(I am unfortunately not remembering all the questions asked, the list below is a selection based on primacy and recency effects.)

Is there any Python or MNE-Python basic functionality I or the participants should know?
Both Python and MNE have some basic functionalities that are beneficial to understand. For longer data analysis workshops, it might make sense to share material that brings all participants to a similar level before the workshop. For tutors, it can make sense to look over that material to see if there is any gaps to fill.
For Python and numpy, there are Jupyter Notebooks covering basic knowledge (developed by Alex Gramfort) that I included as self-studying material for the Practical MEEG workshop. Of course, there is also a lot of courses and material to find online.
For MNE-Python, there is a page explaining the design principles of MNE that could be interesting to look at. There is also a page that details a typical analysis workflow. Further, the first few tutorials give a gentle introduction to MNE, e.g. the very first one “Overview of MEG/EEG analysis with MNE-Python.

If I include exercises, how do I know when the participants are done with them? I find that often the “energy in the room” shifts once a lot of people are finished with the exercise. People will get a bit bored and start doing other things: that is a good moment to bring back structure. I then often ask the participants to raise their hand if they are done / if they need more time. That gives a quick overview and tells you if you should wait a little bit longer or if indeed it’s time to discuss the solutions to the exercise together.

What are some reasons to learn MNE-Python?
Now, here of course we start talking about opinions. Let me preface this by saying that not one data analysis software is better than the others. But there are a couple of things that make MNE-Python distinct which might or might not fit your requirements for an analysis software: Both Python and MNE-Python are open source, i.e., you are not dependent on a Matlab license or similar. MNE-Python serves most state-of-the-art analysis methods in the core package (e.g., time-frequency analysis, source reconstruction methods) and has many “satellite” software packages (e.g., a connectivity toolbox, BIDS integration, automated preprocessing, and many more from independent developers). It has a tight integration with the machine learning software scikit-learn from the mne.decoding module - for an overview of what’s possible see here. And, lastly, as a participant remarked: MNE-Python is computationally fast!