I have a class that initiates as:
MorrisLecarElectricField(external_field=lambda t:0, soma_current=lambda t:0, dend_current=lambda t:0, p=0.5, dt=0.1)
However, if I want to instantiate a bunch of these like such:
neurons = [MLEF.MorrisLecarElectricField(soma_current=lambda t: e) for e in np.arange(0, 200, 10)]
some funky pass by reference seems to be happening. I end up with a list of MorrisLecarElectricField objects that all have soma_current of lambda t: 190.
From what I understand lambdas do something funky with remembering the scope they were created in. Anybody have any idea how to sidestep this issue?