Skip to content

Commit 5f98500

Browse files
Migrate OptimizationBase.jl as sublibrary (pure migration)
This PR migrates OptimizationBase.jl to become a sublibrary within Optimization.jl, consolidating the optimization ecosystem into a single repository while maintaining all existing functionality. This is a pure migration with no code changes. ## Migration Infrastructure - **OptimizationBase sublibrary**: Copied all source code, extensions, and tests to `lib/OptimizationBase/` - **Dependency integration**: Added OptimizationBase dependencies to main Project.toml - **Module structure**: OptimizationBase now loads as a submodule within Optimization.jl - **Import fixes**: Updated OptimizationDIExt.jl and OptimizationDISparseExt.jl imports ## CI Configuration - **Test matrix**: Added OptimizationBase to CI test groups - **Coverage**: Added OptimizationBase source directory to coverage reporting - **Test runner**: Test infrastructure already supports OptimizationBase sublibrary testing ## Testing - OptimizationBase sublibrary: All original tests preserved - Main Optimization.jl module: Successfully loads with embedded OptimizationBase - All existing functionality preserved ## Files Changed - `.github/workflows/CI.yml`: Added OptimizationBase to test matrix and coverage - `Project.toml`: Added OptimizationBase dependencies and removed external OptimizationBase dep - `src/Optimization.jl`: Updated to include OptimizationBase as submodule - `lib/OptimizationBase/`: Complete OptimizationBase source code and tests (pure copy) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 70fcddd commit 5f98500

27 files changed

+4888
-4
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
matrix:
2020
group:
2121
- Core
22+
- OptimizationBase
2223
- OptimizationBBO
2324
- OptimizationCMAEvolutionStrategy
2425
- OptimizationEvolutionary
@@ -66,7 +67,7 @@ jobs:
6667
GROUP: ${{ matrix.group }}
6768
- uses: julia-actions/julia-processcoverage@v1
6869
with:
69-
directories: src,lib/OptimizationBBO/src,lib/OptimizationCMAEvolutionStrategy/src,lib/OptimizationEvolutionary/src,lib/OptimizationGCMAES/src,lib/OptimizationManopt/src,lib/OptimizationMOI/src,lib/OptimizationMetaheuristics/src,lib/OptimizationMultistartOptimization/src,lib/OptimizationNLopt/src,lib/OptimizationNOMAD/src,lib/OptimizationOptimJL/src,lib/OptimizationOptimisers/src,lib/OptimizationPolyalgorithms/src,lib/OptimizationQuadDIRECT/src,lib/OptimizationSpeedMapping/src
70+
directories: src,lib/OptimizationBase/src,lib/OptimizationBBO/src,lib/OptimizationCMAEvolutionStrategy/src,lib/OptimizationEvolutionary/src,lib/OptimizationGCMAES/src,lib/OptimizationManopt/src,lib/OptimizationMOI/src,lib/OptimizationMetaheuristics/src,lib/OptimizationMultistartOptimization/src,lib/OptimizationNLopt/src,lib/OptimizationNOMAD/src,lib/OptimizationOptimJL/src,lib/OptimizationOptimisers/src,lib/OptimizationPolyalgorithms/src,lib/OptimizationQuadDIRECT/src,lib/OptimizationSpeedMapping/src
7071
- uses: codecov/codecov-action@v5
7172
with:
7273
file: lcov.info

Project.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@ version = "4.5.0"
66
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
88
ConsoleProgressMonitor = "88cd18e8-d9cc-4ea6-8889-5259c0d15c8b"
9+
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
910
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
11+
FastClosures = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a"
1012
LBFGSB = "5be7bae1-8223-5378-bac3-9e7378a2f6e6"
1113
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1214
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
1315
LoggingExtras = "e6f89c97-d47a-5376-807f-9c37f3926c36"
14-
OptimizationBase = "bca83a33-5cc9-4baa-983d-23429ab6bcbb"
16+
PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150"
1517
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1618
ProgressLogging = "33c8b6b6-d38a-422a-b730-caa89a2f386c"
1719
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
20+
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
1821
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
1922
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
23+
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
24+
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
2025
TerminalLoggers = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"
2126

2227
[compat]
@@ -28,8 +33,10 @@ Boltz = "1"
2833
ComponentArrays = ">= 0.13.9"
2934
ConsoleProgressMonitor = "0.1.1"
3035
DiffEqFlux = "2, 3, 4"
36+
DifferentiationInterface = "0.7"
3137
DocStringExtensions = "0.9"
3238
Enzyme = "0.13"
39+
FastClosures = "0.3"
3340
FiniteDiff = "2"
3441
Flux = "0.13, 0.14, 0.15, 0.16"
3542
ForwardDiff = "0.10, 1"
@@ -44,11 +51,11 @@ MLUtils = "0.4"
4451
ModelingToolkit = "10"
4552
Mooncake = "0.4.138"
4653
Optim = ">= 1.4.1"
47-
OptimizationBase = "2"
4854
OptimizationMOI = "0.5"
4955
OptimizationOptimJL = "0.4"
5056
OptimizationOptimisers = "0.3"
5157
OrdinaryDiffEqTsit5 = "1"
58+
PDMats = "0.11"
5259
Pkg = "1"
5360
Printf = "1.10"
5461
ProgressLogging = "0.1"
@@ -59,7 +66,9 @@ SafeTestsets = "0.1"
5966
SciMLBase = "2.82"
6067
SciMLSensitivity = "7"
6168
SparseArrays = "1.10"
69+
SparseConnectivityTracer = "0.6, 1"
6270
SparseDiffTools = "2"
71+
SparseMatrixColorings = "0.4"
6372
Symbolics = "6"
6473
TerminalLoggers = "0.1"
6574
Test = "1.10"

lib/OptimizationBase/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Vaibhav Dixit <[email protected]> and contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

lib/OptimizationBase/Project.toml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name = "OptimizationBase"
2+
uuid = "bca83a33-5cc9-4baa-983d-23429ab6bcbb"
3+
authors = ["Vaibhav Dixit <[email protected]> and contributors"]
4+
version = "2.10.0"
5+
6+
[deps]
7+
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
8+
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
9+
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
10+
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
11+
FastClosures = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a"
12+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
13+
PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150"
14+
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
15+
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
16+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
17+
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
18+
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
19+
20+
[weakdeps]
21+
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
22+
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
23+
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
24+
MLDataDevices = "7e8f7934-dd98-4c1a-8fe8-92b47a384d40"
25+
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
26+
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
27+
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
28+
SymbolicAnalysis = "4297ee4d-0239-47d8-ba5d-195ecdf594fe"
29+
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
30+
31+
[extensions]
32+
OptimizationEnzymeExt = "Enzyme"
33+
OptimizationFiniteDiffExt = "FiniteDiff"
34+
OptimizationForwardDiffExt = "ForwardDiff"
35+
OptimizationMLDataDevicesExt = "MLDataDevices"
36+
OptimizationMLUtilsExt = "MLUtils"
37+
OptimizationMTKExt = "ModelingToolkit"
38+
OptimizationReverseDiffExt = "ReverseDiff"
39+
OptimizationSymbolicAnalysisExt = "SymbolicAnalysis"
40+
OptimizationZygoteExt = "Zygote"
41+
42+
[compat]
43+
ADTypes = "1.9"
44+
ArrayInterface = "7.6"
45+
DifferentiationInterface = "0.7"
46+
DocStringExtensions = "0.9"
47+
Enzyme = "0.13.2"
48+
FastClosures = "0.3"
49+
FiniteDiff = "2.12"
50+
ForwardDiff = "0.10.26, 1"
51+
LinearAlgebra = "1.9, 1.10"
52+
MLDataDevices = "1"
53+
MLUtils = "0.4"
54+
ModelingToolkit = "9, 10"
55+
PDMats = "0.11"
56+
Reexport = "1.2"
57+
ReverseDiff = "1.14"
58+
SciMLBase = "2"
59+
SparseConnectivityTracer = "0.6, 1"
60+
SparseMatrixColorings = "0.4"
61+
SymbolicAnalysis = "0.3"
62+
Zygote = "0.6.67, 0.7"
63+
julia = "1.10"
64+
65+
[extras]
66+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
67+
68+
[targets]
69+
test = ["Test"]

0 commit comments

Comments
 (0)