Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of MemoizeJac #161

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions cyipopt/scipy_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@
# in scipy 0.14 Result was renamed to OptimizeResult
from scipy.optimize import Result
OptimizeResult = Result
try:
from scipy.optimize import MemoizeJac
except ImportError:
# The optimize.optimize namespace is being deprecated
from scipy.optimize.optimize import MemoizeJac

import cyipopt

Expand Down Expand Up @@ -90,9 +85,6 @@ def __init__(self,
if jac is None:
jac = lambda x0, *args, **kwargs: approx_fprime(
x0, fun, eps, *args, **kwargs)
elif jac is True:
fun = MemoizeJac(fun)
jac = fun.derivative
elif not callable(jac):
raise NotImplementedError('jac has to be bool or a function')
self.fun = fun
Expand All @@ -116,11 +108,8 @@ def __init__(self,
if con_jac is None:
con_jac = lambda x0, *args, **kwargs: approx_fprime(
x0, con_fun, eps, *args, **kwargs)
elif con_jac is True:
con_fun = MemoizeJac(con_fun)
con_jac = con_fun.derivative
elif not callable(con_jac):
raise NotImplementedError('jac has to be bool or a function')
raise NotImplementedError('jac has to be a function')
if (self.obj_hess is not None
and con_hessian is None) or (self.obj_hess is None
and con_hessian is not None):
Expand Down