ioam / topographica

A general-purpose neural simulator focusing on topographic maps.
topographica.org
BSD 3-Clause "New" or "Revised" License
53 stars 32 forks source link

Passing in parameters from the command-line into notebooks #601

Open jlstevens opened 9 years ago

jlstevens commented 9 years ago

The idea here is that we could parametrize notebooks via the command-line using the usual -p flag and script params. I am not entirely convinced how useful this would be in practice, but I can imagine something like:

./topographica -p cortex_density=48 gcal.ipynb

This would open the specific notebook with the the given script parameter values.

Note that this would be possible to implement in topo.misc.commandline by passing the arguments as IPython config values via sys.argv into the notebook server process. For instance, in the n_action function, you could be set to something like

sys.argv = ['notebook', '--param.cortex_density=60']

which would then be passed into the NotebookApp making it accessible from within the specified notebook (again via sys.argv). This may not be useful unless the notebook is automatically executed (i.e. batch mode) as the user would still need to click on Run All or otherwise run the notebook manually.