modify_arg function

(Shortest import: from brian2.hears import modify_arg)


Modify arguments to make them compatible with Brian 1.

  • Arrays of units are replaced with straight arrays

  • Single values are replaced with Brian 1 equivalents

  • Slices are handled so we can use e.g. sound[:20*ms]

The second part was necessary because some functions/classes test if an object is an array or not to see if it is a sequence, but because brian2.Quantity derives from ndarray this was causing problems.