Skip to content

Conversation

@MohamedLaghdafHABIBOULLAH
Copy link
Collaborator

@MohamedLaghdafHABIBOULLAH MohamedLaghdafHABIBOULLAH commented Oct 15, 2025

To solve this 250 @dpo @MaxenceGollier.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies callback behavior in optimization solvers to properly handle user exit requests. The change allows callbacks to return a boolean value indicating whether the user has requested termination, which is then used to set the solver status appropriately.

Key changes:

  • Updated callback default behavior to return false instead of nothing
  • Added user_requested_exit parameter to status determination logic
  • Modified all solver algorithms to capture and use callback return values

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/utils.jl Added user_requested_exit parameter to get_status function and updated status logic
src/TR_alg.jl Updated callback default and integrated user exit handling in TR solver
src/TRDH_alg.jl Updated callback default and integrated user exit handling in TRDH solver
src/R2_alg.jl Updated callback default, added return statement to internal callback, and integrated user exit handling
src/R2N.jl Updated callback default and integrated user exit handling in R2N solver
src/R2DH.jl Updated callback default and integrated user exit handling in R2DH solver
src/LM_alg.jl Updated callback default and integrated user exit handling in LM solver
src/LMTR_alg.jl Updated callback default and integrated user exit handling in LMTR solver

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

❌ Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.69%. Comparing base (e0f214d) to head (e56afea).
⚠️ Report is 248 commits behind head on master.

Files with missing lines Patch % Lines
src/TRDH_alg.jl 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #251       +/-   ##
===========================================
+ Coverage   61.53%   84.69%   +23.16%     
===========================================
  Files          11       13        +2     
  Lines        1292     1627      +335     
===========================================
+ Hits          795     1378      +583     
+ Misses        497      249      -248     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dpo
Copy link
Member

dpo commented Oct 15, 2025

Please read the documentation. The callback mechanism already allows you to stop. The mechanism is the same as in JSOSolvers.

@dpo dpo closed this Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants