Skip to content

Commit

Permalink
simplify bugfix from last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyjmurray committed Jan 17, 2025
1 parent ec105d6 commit 5779011
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pygsti/optimize/customlm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1129,11 +1129,10 @@ def dclip(ar): return ar
try:
_ = obj_fn(global_x, oob_check=True)
# ^ Dead-store the return value.
new_x_is_known_inbounds = True
except ValueError:
# Then we keep new_x_is_known_inbounds==False.
pass
else:
new_x_is_known_inbounds = True
if new_x_is_known_inbounds:
min_norm_f = norm_f
best_x[:] = x[:]
Expand Down
3 changes: 1 addition & 2 deletions pygsti/optimize/simplerlm.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,11 +789,10 @@ def simplish_leastsq(
try:
_ = obj_fn(global_x, oob_check=True)
# ^ Dead-store the return value.
new_x_is_known_inbounds = True
except ValueError:
# Then we keep new_x_is_known_inbounds==False.
pass
else:
new_x_is_known_inbounds = True
if new_x_is_known_inbounds:
min_norm_f = norm_f
best_x[:] = x[:]
Expand Down

0 comments on commit 5779011

Please sign in to comment.