Skip to content

Commit b1a447d

Browse files
Merge pull request #1014 from ChrisRackauckas-Claude/fix-supports-opt-cache-interface-compatibility
Add compatibility support for supports_opt_cache_interface
2 parents 627344c + 85c5e51 commit b1a447d

File tree

38 files changed

+162
-45
lines changed

38 files changed

+162
-45
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Optimization"
22
uuid = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
3-
version = "4.6.0"
3+
version = "4.7.0"
44

55
[deps]
66
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

lib/OptimizationBBO/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "OptimizationBBO"
22
uuid = "3e6eede4-6085-4f62-9a71-46d9bc1eb92b"
33
authors = ["Vaibhav Dixit <[email protected]> and contributors"]
4-
version = "0.4.1"
4+
version = "0.4.2"
55

66
[deps]
77
BlackBoxOptim = "a134a8b2-14d6-55f6-9291-3336d3ab0209"

lib/OptimizationBBO/src/OptimizationBBO.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ abstract type BBO end
99

1010
SciMLBase.requiresbounds(::BBO) = true
1111
SciMLBase.allowsbounds(::BBO) = true
12-
SciMLBase.supports_opt_cache_interface(opt::BBO) = true
12+
@static if isdefined(SciMLBase, :supports_opt_cache_interface)
13+
SciMLBase.supports_opt_cache_interface(opt::BBO) = true
14+
end
15+
@static if isdefined(OptimizationBase, :supports_opt_cache_interface)
16+
OptimizationBase.supports_opt_cache_interface(opt::BBO) = true
17+
end
1318

1419
for j in string.(BlackBoxOptim.SingleObjectiveMethodNames)
1520
eval(Meta.parse("Base.@kwdef struct BBO_" * j * " <: BBO method=:" * j * " end"))

lib/OptimizationCMAEvolutionStrategy/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "OptimizationCMAEvolutionStrategy"
22
uuid = "bd407f91-200f-4536-9381-e4ba712f53f8"
33
authors = ["Vaibhav Dixit <[email protected]> and contributors"]
4-
version = "0.3.1"
4+
version = "0.3.2"
55

66
[deps]
77
CMAEvolutionStrategy = "8d3b24bd-414e-49e0-94fb-163cc3a3e411"

lib/OptimizationCMAEvolutionStrategy/src/OptimizationCMAEvolutionStrategy.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ export CMAEvolutionStrategyOpt
99
struct CMAEvolutionStrategyOpt end
1010

1111
SciMLBase.allowsbounds(::CMAEvolutionStrategyOpt) = true
12-
SciMLBase.supports_opt_cache_interface(opt::CMAEvolutionStrategyOpt) = true
12+
@static if isdefined(SciMLBase, :supports_opt_cache_interface)
13+
SciMLBase.supports_opt_cache_interface(opt::CMAEvolutionStrategyOpt) = true
14+
end
15+
@static if isdefined(OptimizationBase, :supports_opt_cache_interface)
16+
OptimizationBase.supports_opt_cache_interface(opt::CMAEvolutionStrategyOpt) = true
17+
end
1318
SciMLBase.requiresgradient(::CMAEvolutionStrategyOpt) = false
1419
SciMLBase.requireshessian(::CMAEvolutionStrategyOpt) = false
1520
SciMLBase.requiresconsjac(::CMAEvolutionStrategyOpt) = false

lib/OptimizationEvolutionary/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "OptimizationEvolutionary"
22
uuid = "cb963754-43f6-435e-8d4b-99009ff27753"
33
authors = ["Vaibhav Dixit <[email protected]> and contributors"]
4-
version = "0.4.1"
4+
version = "0.4.2"
55

66
[deps]
77
Evolutionary = "86b6b26d-c046-49b6-aa0b-5f0f74682bd6"

lib/OptimizationEvolutionary/src/OptimizationEvolutionary.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ using Optimization.SciMLBase
66

77
SciMLBase.allowsbounds(opt::Evolutionary.AbstractOptimizer) = true
88
SciMLBase.allowsconstraints(opt::Evolutionary.AbstractOptimizer) = true
9-
SciMLBase.supports_opt_cache_interface(opt::Evolutionary.AbstractOptimizer) = true
9+
@static if isdefined(SciMLBase, :supports_opt_cache_interface)
10+
SciMLBase.supports_opt_cache_interface(opt::Evolutionary.AbstractOptimizer) = true
11+
end
12+
@static if isdefined(OptimizationBase, :supports_opt_cache_interface)
13+
OptimizationBase.supports_opt_cache_interface(opt::Evolutionary.AbstractOptimizer) = true
14+
end
1015
SciMLBase.requiresgradient(opt::Evolutionary.AbstractOptimizer) = false
1116
SciMLBase.requiresgradient(opt::Evolutionary.NSGA2) = false
1217
SciMLBase.requireshessian(opt::Evolutionary.AbstractOptimizer) = false

lib/OptimizationGCMAES/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "OptimizationGCMAES"
22
uuid = "6f0a0517-dbc2-4a7a-8a20-99ae7f27e911"
33
authors = ["Vaibhav Dixit <[email protected]> and contributors"]
4-
version = "0.3.0"
4+
version = "0.3.1"
55

66
[deps]
77
GCMAES = "4aa9d100-eb0f-11e8-15f1-25748831eb3b"

lib/OptimizationGCMAES/src/OptimizationGCMAES.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ struct GCMAESOpt end
1111
SciMLBase.requiresbounds(::GCMAESOpt) = true
1212
SciMLBase.allowsbounds(::GCMAESOpt) = true
1313
SciMLBase.allowscallback(::GCMAESOpt) = false
14-
SciMLBase.supports_opt_cache_interface(opt::GCMAESOpt) = true
14+
@static if isdefined(SciMLBase, :supports_opt_cache_interface)
15+
SciMLBase.supports_opt_cache_interface(opt::GCMAESOpt) = true
16+
end
17+
@static if isdefined(OptimizationBase, :supports_opt_cache_interface)
18+
OptimizationBase.supports_opt_cache_interface(opt::GCMAESOpt) = true
19+
end
1520
SciMLBase.requiresgradient(::GCMAESOpt) = true
1621
SciMLBase.requireshessian(::GCMAESOpt) = false
1722
SciMLBase.requiresconsjac(::GCMAESOpt) = false

lib/OptimizationIpopt/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "OptimizationIpopt"
22
uuid = "43fad042-7963-4b32-ab19-e2a4f9a67124"
33
authors = ["Sebastian Micluța-Câmpeanu <[email protected]> and contributors"]
4-
version = "0.1.1"
4+
version = "0.1.2"
55

66
[deps]
77
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"

0 commit comments

Comments
 (0)