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

Import MemoizeJac from scipy.optimize._optimize. #183

Merged
merged 1 commit into from
Feb 13, 2023
Merged
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
11 changes: 6 additions & 5 deletions cyipopt/scipy_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
from scipy.optimize import Result
OptimizeResult = Result
try:
from scipy.optimize import MemoizeJac
# MemoizeJac has been made a private class, see
# https://github.com/scipy/scipy/issues/17572
from scipy.optimize._optimize import MemoizeJac
except ImportError:
# The optimize.optimize namespace is being deprecated
from scipy.optimize.optimize import MemoizeJac
try:
from scipy.sparse import coo_array
Expand Down Expand Up @@ -67,18 +68,18 @@ class IpoptProblemWrapper(object):
constraints : {Constraint, dict} or List of {Constraint, dict}, optional
See https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html
for more information. Note that the jacobian of each constraint
corresponds to the `'jac'` key and must be a callable function
corresponds to the `'jac'` key and must be a callable function
with signature ``jac(x) -> {ndarray, coo_array}``. If the constraint's
value of `'jac'` is a boolean and True, the constraint function `fun`
is expected to return a tuple `(con_val, con_jac)` consisting of the
is expected to return a tuple `(con_val, con_jac)` consisting of the
evaluated constraint `con_val` and the evaluated jacobian `con_jac`.
eps : float, optional
Epsilon used in finite differences.
con_dims : array_like, optional
Dimensions p_1, ..., p_m of the m constraint functions
g_1, ..., g_m : R^n -> R^(p_i).
sparse_jacs: array_like, optional
If sparse_jacs[i] = True, the i-th constraint's jacobian is sparse.
If sparse_jacs[i] = True, the i-th constraint's jacobian is sparse.
Otherwise, the i-th constraint jacobian is assumed to be dense.
jac_nnz_row: array_like, optional
The row indices of the nonzero elements in the stacked
Expand Down