Skip to content

Changed trait constraints to solve.jl for calculation of gradients, hessians and more. #651 #659

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

Merged
merged 4 commits into from
Apr 19, 2024

Conversation

ParasPuneetSingh
Copy link
Contributor

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Add any other context about the problem here.

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.78%. Comparing base (ae4f9a8) to head (caafb86).
Report is 27 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #659      +/-   ##
==========================================
+ Coverage   31.29%   34.78%   +3.48%     
==========================================
  Files          55       55              
  Lines        4358     4905     +547     
==========================================
+ Hits         1364     1706     +342     
- Misses       2994     3199     +205     

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

ParasPuneetSingh and others added 2 commits April 9, 2024 13:33
Co-authored-by: Vaibhav Kumar Dixit <vaibhavyashdixit@gmail.com>
updated error messages.
src/solve.jl Outdated
@@ -116,6 +116,14 @@ function _check_opt_alg(prob::OptimizationProblem, alg; kwargs...)
throw(IncompatibleOptimizerError("The algorithm $(typeof(alg)) requires constraints, pass them with the `cons` kwarg in `OptimizationFunction`."))
!allowscallback(alg) && haskey(kwargs, :callback) &&
throw(IncompatibleOptimizerError("The algorithm $(typeof(alg)) does not support callbacks, remove the `callback` keyword argument from the `solve` call."))
!requiresgradient(alg) && !(prob.f::OptimizationFunction) &&
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
!requiresgradient(alg) && !(prob.f::OptimizationFunction) &&
!requiresgradient(alg) && !(prob.f isa OptimizationFunction) &&

@Vaibhavdixit02 Vaibhavdixit02 merged commit 8e7c260 into SciML:master Apr 19, 2024
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