openopt / copt

A Python library for mathematical optimization
http://openo.pt/copt
Other
135 stars 35 forks source link

FIX np.NaN is not available anymore in numpy2.0 #111

Closed tomMoral closed 1 week ago

tomMoral commented 2 weeks ago

Just notived a failure with numpy 2.0. This is a quick fix for the failure I observed.

tomMoral commented 2 weeks ago

Not sure how to cope with the missing AttributeError:scipy.optimize.optimizehas no attributeMemoizeJac`

arokem commented 2 weeks ago

This seems relevant: https://github.com/scipy/scipy/issues/17572#issuecomment-1368482400

arokem commented 2 weeks ago

Looks like this works:

from scipy.optimize._optimize import MemoizeJac
arokem commented 2 weeks ago

Looks good! Unless anyone objects, I can go ahead and merge it in a couple of days.

tomMoral commented 2 weeks ago

Great :)

Note that we saw this failure in the test of our benchmark on logreg l2, where we benchmark copt against other solvers :) https://github.com/benchopt/benchmark_logreg_l2

It has been a while since we updated the copt solver so if you think we can improve its performances, feel free to contribute updates to the copt solver

fabianp commented 1 week ago

thanks all!