-
Notifications
You must be signed in to change notification settings - Fork 60
minimize_ipopt raises TypeError for tol
argument
#235
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
Comments
tol
argument
@mdhaber this may be from some changes you've added in 1.3.0. Looks like tol is converted to a numpy array. if tol is not None:
tol = np.asarray(tol)[()]
if tol.ndim != 0 or not np.issubdtype(tol.dtype, np.number) or tol <= 0:
raise ValueError('`tol` must be a positive scalar.') |
I've made a simple fix for this and can make a bug fix release soon. |
Hmm. If import numpy as np
x = 1.0
y = np.asarray(x)[()]
isinstance(y, type(x)) # True So I didn't think that was backward incompatible. I added a test of
tol parameter before that checked it for IPOPT.
In any case, sorry for the trouble. |
No trouble, its part of the process :) |
Uh oh!
There was an error while loading. Please reload this page.
Problem
Minimization using
cyipopt.minimize_ipopt
raises aTypeError
for thetol
argument on the same code in version 1.3.0 but not in version 1.2.0. Please take a look at the minimal reproducible example below.Minimal reproducible example
Error excerpt:
Probably caused by
It seems that
cyipopt.minimize_ipopt
calls the functioncyipopt.scipy_interface._minimize_ipopt_iv
internally (l.534), which converts the argumenttol
to anumpy.float
(l.668), which then causesnlp.add_option(option, value)
(l.598) to raise the TypeError.Full error message
The text was updated successfully, but these errors were encountered: