Repository: mne-tools/mne-python

Issue:
ENH: Auto-build examples or tutorials that are modified
Fun project for someone if they get bored. CircleCI currently builds full docs `html_dev` on `master` and `html_dev-noplot` on PRs. But really on PRs it should build `PATTERN=... make html_dev-pattern` when the PR touches an example or tutorial. So some enterprising person could inspect the `diff` and figure out if any of the files live in `examples/` or `tutorials/` and call the pattern version.

@jaeilepp fancy a challenge? :)



Discussion:
I'm not super sure I agree with this because in principle you could break an example from a diff not in the example ... to me, CircleCI is also a testing mechanism 

Unfortunately it is not feasible to run all examples for every PR from a
build time standpoint, so this is probably the best we can do for now

let's keep this for a sunday hack

> I'm not super sure I agree with this because in principle you could break an example from a diff not in the example ... to me, CircleCI is also a testing mechanism

But this change wouldn't remove the `dev-noplot` build. It would just add building of the modified examples/tutorials. Right?

> But this change wouldn't remove the dev-noplot build. It would just add building of the modified examples/tutorials. Right?

It would replace the `make html_dev-noplot` with `make html_dev-pattern`, thus making the testing (and usefulness in reviews) more complete than it is now.


Resolving patch:
diff --git a/mne/surface.py b/mne/surface.py
--- a/mne/surface.py
+++ b/mne/surface.py
@@ -417,6 +417,7 @@ def read_surface(fname, read_metadata=False, verbose=None):
     read_metadata : bool
         Read metadata as key-value pairs.
         Valid keys:
+
             * 'head' : array of int
             * 'valid' : str
             * 'filename' : str
@@ -441,6 +442,7 @@ def read_surface(fname, read_metadata=False, verbose=None):
         together form a face).
     volume_info : dict-like
         If read_metadata is true, key-value pairs found in the geometry file.
+
     See Also
     --------
     write_surface
@@ -728,6 +730,7 @@ def write_surface(fname, coords, faces, create_stamp='', volume_info=None):
     volume_info : dict-like or None
         Key-value pairs to encode at the end of the file.
         Valid keys:
+
             * 'head' : array of int
             * 'valid' : str
             * 'filename' : str
diff --git a/tutorials/plot_background_filtering.py b/tutorials/plot_background_filtering.py
--- a/tutorials/plot_background_filtering.py
+++ b/tutorials/plot_background_filtering.py
@@ -462,7 +462,7 @@ def plot_signal(x, offset):
 # Applying IIR filters
 # --------------------
 # Now let's look at how our shallow and steep Butterworth IIR filters
-# perform on our morlet signal from before:
+# perform on our Morlet signal from before:
 
 axs = plt.subplots(2)[1]
 yticks = np.arange(4) / -30.
diff --git a/tutorials/plot_visualize_raw.py b/tutorials/plot_visualize_raw.py
--- a/tutorials/plot_visualize_raw.py
+++ b/tutorials/plot_visualize_raw.py
@@ -100,7 +100,7 @@
 raw.plot_psd()
 
 ###############################################################################
-# Plotting channel wise power spectra is just as easy. The layout is inferred
+# Plotting channel-wise power spectra is just as easy. The layout is inferred
 # from the data by default when plotting topo plots. This works for most data,
 # but it is also possible to define the layouts by hand. Here we select a
 # layout with only magnetometer channels and plot it. Then we plot the channel


Test patch:
diff --git a/mne/tests/test_bem.py b/mne/tests/test_bem.py
--- a/mne/tests/test_bem.py
+++ b/mne/tests/test_bem.py
@@ -73,8 +73,7 @@ def _compare_bem_solutions(sol_a, sol_b):
 
 @testing.requires_testing_data
 def test_io_bem():
-    """Test reading and writing of bem surfaces and solutions
-    """
+    """Test reading and writing of bem surfaces and solutions"""
     tempdir = _TempDir()
     temp_bem = op.join(tempdir, 'temp-bem.fif')
     assert_raises(ValueError, read_bem_surfaces, fname_raw)