[SciPy-user] Bug in openopt: objFunrelated

Mclean Edwards mcleane@math.ubc...
Wed Jan 30 23:41:34 CST 2008


For a user supplied gradient that is not iterable, user_df in 
objFunRelated.py returns an UnboundLocalError since user_df_func in 
reference before it is assigned.

Looking at the code, this is obvious.

Suggest a line after 116 as an else to the if on 112:

else: user_df_func = p.user.df

When openopt is compiled with this change, the solver runs without 
crashing, and my NLP runs to an approximate solution on all the major 
solvers. I see no reason not to adopt this change.


Cheers,

Mclean


More information about the SciPy-user mailing list