ioam / ioam-builder

Code for building documentation and running tests across IOAM
1 stars 1 forks source link

Added skip_output option to notebook directive #11

Closed jlstevens closed 7 years ago

jlstevens commented 7 years ago

The skip_execute option is not suitable for stream examples in longer notebooks when you do want certain output but not where GIFs appear. This PR adds the skip_output option, for for example:

.. notebook:: holoviews Homepage.ipynb
   :skip_execute: True
   :skip_output: When run live, this cell's output should match the behavior of the GIF below

If the cell you want to skip is something like:

%%opts Points [scaling_factor=50] Contours (color='w')
dots = np.linspace(-0.45, 0.45, 19)
# When run live, this cell's output should match the behavior of the GIF below
layouts = {y: (fractal * hv.Points(fractal.sample([(i,y) for i in dots])) +
               fractal.sample(y=y) +
               hv.operation.threshold(fractal, level=np.percentile(fractal.sample(y=y)['z'], 90)) +
               hv.operation.contours(fractal, levels=[np.percentile(fractal.sample(y=y)['z'], 60)]))
            for y in np.linspace(-0.3, 0.3, 21)}

hv.HoloMap(layouts, kdims=['Y']).collate().cols(2)

What it does is a substring match which decides if the output should be stripped out or not.

philippjfr commented 7 years ago

Looks good, merging