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

Make IPython features work well with objects in topo.sim #464

Closed sf-issues closed 10 years ago

sf-issues commented 12 years ago

Converted from SourceForge issue 3420578, submitted by ceball Submit Date: 2011-10-08 12:59 GMT

IPython doesn't know about things in topo.sim:

topo_t000000.00_c1>>> topo.sim? Type:Simulation Base Class:<class 'topo.base.simulation.Simulation'> String Form: Namespace:Interactive File:/home/ceball/topographica-git/topo/base/simulation.py Docstring: A simulation class that uses a simple sorted event list (instead of [...]

topo_t000000.00_c2>>> topo.sim['V1']? Object topo.sim['V1'] not found.

topo_t000000.00_c3>>> v1 = topo.sim['V1']

topo_t000000.00_c4>>> v1? Type:CFSheet Base Class:<class 'topo.base.cf.CFSheet'> String Form: Namespace:Interactive File:/home/ceball/topographica-git/topo/base/cf.py Docstring: A ProjectionSheet providing access to the ConnectionFields in its CFProjections. [...]

Also affects autocomplete (and presumably whatever else IPython can do).

ceball commented 10 years ago

Seems like things work better with ipython now :)

Tab completion works (e.g. when I run tiny.ty in a terminal, "topo.sim." followed by tab includes Retina and V1 as possible completions. Also, "topo.sim.V1?" works as expected.

("topo.sim['V1']?" gives back info about topo.sim rather than topo.sim['V1'], but if nobody accesses things that way any more then presumably it doesn't really matter...)

jlstevens commented 10 years ago

Topographica now supports tab completion of sheets, projections and view objects starting from topo.sim. In IPython Notebook, many objects in Topographica are now automatically displayed including sheets, projections, sheetviews and patterns.