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

fatal KeyError: 'Lgnonafferent' on generate_example('gcal_10000.typ') #560

Closed davidljung closed 10 years ago

davidljung commented 10 years ago

After installing Topographica from GitHub (on an Ubuntu 14.04 LTS EC2 instance) and executing:

./topographica -a -c "generate_example('gcal_10000.typ')"

it runs for about 15mins and then crashes with the following:

Traceback (most recent call last):
  File "./topographica", line 8, in <module>
    process_argv(sys.argv[1:])
  File "/mnt/storage/topographica/topo/misc/commandline.py", line 704, in process_argv
    (option,args) = topo_parser.parse_args(args,option)
  File "/usr/lib/python2.7/optparse.py", line 1400, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.7/optparse.py", line 1444, in _process_args
    self._process_short_opts(rargs, values)
  File "/usr/lib/python2.7/optparse.py", line 1551, in _process_short_opts
    option.process(opt, value, values, self)
  File "/usr/lib/python2.7/optparse.py", line 789, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib/python2.7/optparse.py", line 809, in take_action
    self.callback(self, opt, value, parser, *args, **kwargs)
  File "/mnt/storage/topographica/topo/misc/commandline.py", line 483, in c_action
    exec value in __main__.__dict__
  File "<string>", line 1, in <module>
  File "/mnt/storage/topographica/external/param/param/parameterized.py", line 1638, in __new__
    return inst.__call__(*args,**params)
  File "/mnt/storage/topographica/topo/analysis/command.py", line 176, in __call__
    p.measurement_storage_hook(results)
  File "/mnt/storage/topographica/topo/analysis/featureresponses.py", line 346, in __call__
    source = objects[src_name]
KeyError: 'Lgnonafferent'
Tobias-Fischer commented 10 years ago

This bug was introduced in commit https://github.com/ioam/topographica/commit/f399c0c8f4ab57a6795fa8238acb07cbacf6d794

For some reason the proj.name is capitalized with proj.name.capitalize() - that changes the string "LGNOnAfferent" to "Lgnonafferent" which is not a key in gcal.ty, and therefore a KeyError is raised. The same might happen with the sheet.name as well!

@jlstevens : is there any reason for the capitalize?

jlstevens commented 10 years ago

Well spotted Tobias!

The first letter must be capitalized to work with AttrTree and I didn't realize that the capitalize method affects anything other than the first letter.

I'm currently testing a fix which will be committed as soon as I can confirm that it resolves this issue.

jbednar commented 10 years ago

Seems fixed now; thanks for raising the issue, and thanks Jean-Luc for fixing it!

davidljung commented 10 years ago

Indeed - works for me also - thanks!