I would like to be able to maintain a series of notebooks as reusable templates and to execute these for a set of run-time parameters, keeping the results for each. The point is to be able to avoid forking the code; the effect I am looking for would be equivalent to having multiple copies of the same notebook differing only by a cell containing a handful of variable initialisations. The reusable code is subject to change and extension, and I would still like to be able to explore the state after executing the "reusable" notebook, by adding cells into the notebook which executes it.
I currently use the %run magic, passing it a *.ipynb file. This works insomuch as the stdout and stderr and inline plots come through into the calling notebook.
The limitation of this is that I loose any headings and notes and have to resort to extensive print "...." to create headings. This makes the output much less presentable to stakeholders.
As far as I can tell, nbconvert does not allow me to pass in variables. It could be used to automate the process by writing a file of runtime parameters to a consistent location before nb-converting the "reusable" and saving, but this feels rather inelegant.
Anyone got any good ideas??
Cheers, Adam