Ticket #65 (assigned enhancement)

Opened 7 months ago

Last modified 7 months ago

Add a `get_simulator()` function

Reported by: apdavison Assigned to: apdavison (accepted)
Priority: minor Milestone: 0.5.0
Component: common Version: trunk
Keywords: Cc:

Description (Last modified by apdavison)

Currently, I tend to do:

  import sys
  simulator = sys.argv[1]
  exec("import pyNN.%s as sim" % simulator)

to let the simulator be specified on the command line.

To reduce this to a single statement, and add error checking, it would be useful to encapsulate it in a function in common, and use optparse from the standard library to handle passing additional arguments and options.

Change History

04/09/08 13:42:27 changed by apdavison

  • description changed.

04/09/08 13:47:47 changed by apdavison

  • type changed from defect to enhancement.

04/25/08 13:33:41 changed by apdavison

  • status changed from new to assigned.

optparse doesn't handle mpirun very well.

Have implemented pyNN.utility.get_script_args(), which does some of this.