Skip to content

Commit 4d37775

Browse files
Transurgeonclaude
andcommitted
Remove debug print and expand comment in best_of loop
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5b3eb31 commit 4d37775

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cvxpy/reductions/solvers/nlp_solving_chain.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,17 @@ def solve_nlp(problem, solver, warm_start, verbose, **kwargs):
198198
solution = nlp_chain.solver.solve_via_data(canon_problem, warm_start,
199199
verbose, solver_opts=kwargs)
200200

201-
# Unpack to get the objective value in the original problem space
201+
# Unpack to get the objective value in the original problem space.
202+
# If we do obj_value = canon_problem['objective'] we get the objective
203+
# value of the canonicalized problem which can be slightly different
204+
# from that of the original NLP. We therefore implement this approach
205+
# based on unpacking.
202206
problem.unpack_results(solution, nlp_chain, inverse_data)
203207
obj_value = problem.objective.value
204208

205209
all_objs[run] = obj_value
206210
if obj_value < best_obj:
207211
best_obj = obj_value
208-
print("best_obj: ", best_obj)
209212
best_solution = solution
210213

211214
# Unpack best solution

0 commit comments

Comments
 (0)