Skip to content

Commit 4372e2c

Browse files
jClugstorclaude
andcommitted
More sublibrary QA fixes: compat entries + JET nothing-guard
- OptimizationManopt: add [compat] for the Aqua-check_extras extras (Aqua, QuadraticModels, Random, ReverseDiff, RipQP, Test, Zygote); its Aqua run was previously masked by the qa.jl syntax error. - OptimizationBase: add Mooncake weakdep compat ("0.4.138, 0.5", matching the root project) for Aqua check_weakdeps. - OptimizationBase (function.jl): guard `open_brkt_ind` against `nothing` before subtracting in the AD-package-not-loaded error path. JET could not prove the elseif branches return an Int, so it flagged `-(::Nothing, ::Int64)` (same fix as SimpleOptimization, which copied this code). With this, the earlier DISparseExt hoist cleared OptimizationBase's 6 cons_oop/lagrangian JET findings, leaving only this one, now fixed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 48f0b2f commit 4372e2c

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

lib/OptimizationBase/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ LinearAlgebra = "1.9, 1.10"
6666
Lux = "1.12"
6767
MLDataDevices = "1"
6868
MLUtils = "0.4"
69+
Mooncake = "0.4.138, 0.5"
6970
Manifolds = "0.10, 0.11"
7071
ModelingToolkit = "11"
7172
Optim = ">= 1.4.1"

lib/OptimizationBase/src/function.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ function instantiate_function(
273273
else
274274
min(open_nrmlbrkt_ind, open_squigllybrkt_ind)
275275
end
276-
adpkg = adtypestr[strtind:(open_brkt_ind - 1)]
276+
lastidx = isnothing(open_brkt_ind) ? lastindex(adtypestr) : (open_brkt_ind - 1)
277+
adpkg = adtypestr[strtind:lastidx]
277278
throw(ArgumentError("The passed automatic differentiation backend choice is not available. Please load the corresponding AD package $adpkg."))
278279
end

lib/OptimizationManopt/Project.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,15 @@ Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
3333
OptimizationBase = {path = "../OptimizationBase"}
3434

3535
[compat]
36+
Aqua = "0.8"
3637
Pkg = "1"
38+
QuadraticModels = "0.9"
39+
Random = "1.10"
40+
ReverseDiff = "1.14"
41+
RipQP = "0.7"
3742
SafeTestsets = "0.1"
43+
Test = "1.10"
44+
Zygote = "0.6.67, 0.7"
3845
julia = "1.10"
3946
Dates = "1.10"
4047
DifferentiationInterface = "0.7.13"

0 commit comments

Comments
 (0)