Skip to content

Commit bfdc115

Browse files
refactor: remove AutoModelingToolkit
1 parent ae66870 commit bfdc115

File tree

3 files changed

+1
-45
lines changed

3 files changed

+1
-45
lines changed

lib/OptimizationBase/Project.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
2323
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
2424
MLDataDevices = "7e8f7934-dd98-4c1a-8fe8-92b47a384d40"
2525
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
26-
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
27-
ModelingToolkitBase = "7771a370-6774-4173-bd38-47e70ca0b839"
2826
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
2927
SymbolicAnalysis = "4297ee4d-0239-47d8-ba5d-195ecdf594fe"
3028
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
@@ -35,8 +33,6 @@ OptimizationFiniteDiffExt = "FiniteDiff"
3533
OptimizationForwardDiffExt = "ForwardDiff"
3634
OptimizationMLDataDevicesExt = "MLDataDevices"
3735
OptimizationMLUtilsExt = "MLUtils"
38-
OptimizationMTKExt = "ModelingToolkit"
39-
OptimizationMTKBaseExt = "ModelingToolkitBase"
4036
OptimizationReverseDiffExt = "ReverseDiff"
4137
OptimizationSymbolicAnalysisExt = "SymbolicAnalysis"
4238
OptimizationZygoteExt = "Zygote"
@@ -53,8 +49,6 @@ ForwardDiff = "0.10.26, 1"
5349
LinearAlgebra = "1.9, 1.10"
5450
MLDataDevices = "1"
5551
MLUtils = "0.4"
56-
ModelingToolkit = "10.23, 11"
57-
ModelingToolkitBase = "1"
5852
PDMats = "0.11"
5953
Reexport = "1.2"
6054
ReverseDiff = "1.14"

lib/OptimizationBase/src/adtypes.jl

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -88,44 +88,6 @@ Hessian is not defined via ForwardDiff.
8888
"""
8989
AutoForwardDiff
9090

91-
"""
92-
AutoModelingToolkit <: AbstractADType
93-
94-
An AbstractADType choice for use in OptimizationFunction for automatically
95-
generating the unspecified derivative functions. Usage:
96-
97-
```julia
98-
OptimizationFunction(f, AutoModelingToolkit(); kwargs...)
99-
```
100-
101-
This uses the [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl)
102-
package's `modelingtookitize` functionality to generate the derivatives and other fields of an `OptimizationFunction`.
103-
This backend creates the symbolic expressions for the objective and its derivatives as well as
104-
the constraints and their derivatives. Through `structural_simplify`, it enforces simplifications
105-
that can reduce the number of operations needed to compute the derivatives of the constraints. This automatically
106-
generates the expression graphs that some solver interfaces through OptimizationMOI like
107-
[AmplNLWriter.jl](https://github.com/jump-dev/AmplNLWriter.jl) require.
108-
109-
- Compatible with GPUs
110-
- Compatible with Hessian-based optimization
111-
- Compatible with Hv-based optimization
112-
- Compatible with constraints
113-
114-
Note that only the unspecified derivative functions are defined. For example,
115-
if a `hess` function is supplied to the `OptimizationFunction`, then the
116-
Hessian is not generated via ModelingToolkit.
117-
118-
## Constructor
119-
120-
```julia
121-
AutoModelingToolkit(false, false)
122-
```
123-
124-
- `obj_sparse`: to indicate whether the objective hessian is sparse.
125-
- `cons_sparse`: to indicate whether the constraints' jacobian and hessian are sparse.
126-
127-
"""
128-
AutoModelingToolkit
12991

13092
"""
13193
AutoReverseDiff <: AbstractADType

lib/OptimizationOptimJL/test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ end
163163
@test 10 * sol.objective < l1
164164

165165
optprob = OptimizationFunction(rosenbrock,
166-
OptimizationBase.AutoModelingToolkit(true, false))
166+
OptimizationBase.AutoSparse(OptimizationBase.AutoSymbolics()))
167167
prob = OptimizationProblem(optprob, x0, _p)
168168
sol = solve(prob, Optim.Newton())
169169
@test 10 * sol.objective < l1

0 commit comments

Comments
 (0)