[SciPy-User] optimize_leastsq : error calling the function

Matt Newville newville at cars.uchicago.edu
Sat Aug 3 08:41:40 EDT 2013


Hi,

I didn't see any other responses to your question, so I'll try.

Though the error messages you're getting aren't very helpful, I
believe the basic issue is that you're expecting several global
variables to be accessible in your objective function
residual_global().  I would recommend that you instead add
dico_taille_variable as a keyword argument to residual_global, and
pass that in with
   scipy.optimize_leastsq(residual_global, VARIABLES,
args=(dico_taille_variable,))

Also, in your objective function it wasn't clear how 'D.residuals()'
and D.retresi was supposed to be found.  I think you may want to pass
in a list or dictionary of the individual instances of your  Drilling
class.

Hope that helps,
--Matt



More information about the SciPy-User mailing list