Skip to content

add getter functions in solve_problems#197

Merged
dpo merged 3 commits intoJuliaSmoothOptimizers:mainfrom
MaxenceGollier:switch-getters
Apr 1, 2026
Merged

add getter functions in solve_problems#197
dpo merged 3 commits intoJuliaSmoothOptimizers:mainfrom
MaxenceGollier:switch-getters

Conversation

@MaxenceGollier
Copy link
Copy Markdown
Contributor

@tmigot, @amontoison, @dpo

This is safer, it allows to run this with more general subtypes of AbstractNLPModels.
@dpo, this allows to use the benchmarks for AbstractRegularizedNLPModels.

Can one of you review when you have some time ?
I'd need a release afterwards. Thank you!

Copilot AI review requested due to automatic review settings March 6, 2026 14:31
Copy link
Copy Markdown

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 replaces direct field access on AbstractNLPModel instances with getter functions from the NLPModels package in solve_problems. This makes the function compatible with more general subtypes of AbstractNLPModels (such as AbstractRegularizedNLPModels) that may not expose the same internal field structure.

Changes:

  • Replaced problem.meta.name, problem.meta.nvar, problem.meta.ncon with get_name(problem), get_nvar(problem), get_ncon(problem) for problem info gathering.
  • Replaced direct counter field access (problem.counters.counters / problem.counters) with dynamic getter function calls via getfield(NLPModels, f)(problem) for both regular and NLS counters.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/run_solver.jl
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.19%. Comparing base (4c0fcd2) to head (129bb64).
⚠️ Report is 36 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #197      +/-   ##
==========================================
+ Coverage   76.71%   86.19%   +9.48%     
==========================================
  Files          12       10       -2     
  Lines         292      297       +5     
==========================================
+ Hits          224      256      +32     
+ Misses         68       41      -27     

☔ 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.

Comment thread src/run_solver.jl
Comment thread src/run_solver.jl Outdated
@MaxenceGollier MaxenceGollier requested review from dpo and tmigot March 24, 2026 20:29
@MaxenceGollier
Copy link
Copy Markdown
Contributor Author

@dpo, again, this one is not on me, it looks like it has been a while since the Documentation workflow and Examples are failing... I think I will end up fixing the workflows of all JSO repos..

@dpo dpo merged commit b8a08de into JuliaSmoothOptimizers:main Apr 1, 2026
16 of 21 checks passed
@MaxenceGollier MaxenceGollier mentioned this pull request Apr 2, 2026
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.

4 participants