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

gui_repr for recording actions in the GUI #455

Closed sf-issues closed 10 years ago

sf-issues commented 12 years ago

Converted from SourceForge issue 3418073, submitted by jbednar Submit Date: 2011-10-03 20:36 GMT

The run_batch command saves the script file and how the simulator was invoked, so that the user has a permanent record of that particular run should it ever need to be recreated or queried. Because the GUI is scriptable, we should be able to provide something similar for the GUI -- a log of all or nearly all the GUI commands as each one is executed in the GUI in a particular run. This gui_repr file would be like a script_repr file (see script_repr()), in that it would be a (nearly?) runnable script to recreate a series of commands to open the GUI, open windows, set their parameters, etc. E.g.:

topo.misc.commandline.gui() w1=topo.guimain['Plots']['Activity']() w2=topo.guimain['Plots']['Connection Fields']() w2.x=0.1 w2.y=0.2 w2.sheet=topo.sim['V1'] w2.refresh() topo.sim.run(1.0) topo.sim.run(1.0) topo.sim.run(1.0) topo.sim.run(100.0) ...

This list could get quite long, but even if it is, it seems like it should be useful, especially if it's runnable. If it's not quite runnable, it would still be great to have as a reference. Colaescing multiple subcommands (e.g. topo.sim.run(103.0)) would be possible and helpful, but probably too much work.

Chris Ball believes that he may have tried it out already, using python logging to record all gui actions, but if so he isn't sure where the implementation might be. He doesn't think it involved much code. (Fermat's last theorem, anyone? :-)

jlstevens commented 10 years ago

Is this still worth considering now we are moving to IPython Notebook?

The IPython notebook automatically keeps a record of the steps needed to generate figures and visualizations making this idea redundant (although the idea itself was rather neat!)