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

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

Merged
merged 3 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion copt/constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __call__(self, x):
if np.abs(x).sum() <= self.alpha:
return 0
else:
return np.infty
return np.inf

def prox(self, x, step_size=None):
"""Projection onto the L-infinity ball.
Expand Down
2 changes: 1 addition & 1 deletion copt/proximal_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _prox(x, _):
prox = _prox

success = False
certificate = np.NaN
certificate = np.nan

func_and_grad = utils.build_func_grad(jac, fun, args, eps)

Expand Down
2 changes: 1 addition & 1 deletion copt/splitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def prox_2_conj(x, ss):
ss_ratio = tau / sigma

fk, grad_fk = f_grad(x)
norm_incr = np.infty
norm_incr = np.inf
x_next = x.copy()

for it in range(max_iter):
Expand Down
2 changes: 1 addition & 1 deletion copt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def wrapper(*args, **kwargs):
def build_func_grad(jac, fun, args, eps):
if not callable(jac):
if bool(jac):
fun = optimize.optimize.MemoizeJac(fun)
fun = optimize._optimize.MemoizeJac(fun)
jac = fun.derivative
elif jac == "2-point":
jac = None
Expand Down
Loading