Support Optim v2 - #69
Merged
Merged
Conversation
Optim v2 takes the autodiff backend as an ADTypes object instead of a symbol, so pass AutoForwardDiff() explicitly. This also works with Optim v1.13 (NLSolversBase v7.9+), which becomes the lower bound; ForwardDiff is added as a direct dependency because NLSolversBase v8 no longer loads it itself. Created by generative AI.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #69 +/- ##
=======================================
Coverage 89.63% 89.63%
=======================================
Files 10 10
Lines 627 627
=======================================
Hits 562 562
Misses 65 65 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Optim v2 takes the
autodiffbackend as anADTypes.AbstractADTypeinstead of a symbol, soautodiff=:forwardnow throws aMethodError(which is why #63 was red). This passesAutoForwardDiff()explicitly at both call sites, addsADTypesandForwardDiffas direct dependencies (NLSolversBase v8 no longer loads ForwardDiff itself), and setsOptim = "1.13, 2"— v1.13 is the first 1.x whose NLSolversBase accepts ADTypes objects (v1.12 also fails with current LineSearches for unrelated reasons).Tests pass locally with Optim v1.13.3 and v2.2.2.
Supersedes #63.
🤖 Generated with Claude Code