Skip to content

Commit

Permalink
Move import/export functions to CTBase (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreMartinon authored Dec 2, 2024
1 parent 90a5961 commit 77f7fa8
Show file tree
Hide file tree
Showing 19 changed files with 12 additions and 334 deletions.
7 changes: 1 addition & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CTDirect"
uuid = "790bbbee-bee9-49ee-8912-a9de031322d5"
authors = ["Olivier Cots <[email protected]>"]
version = "0.13.0"
version = "0.14.0"

[deps]
ADNLPModels = "54578032-b7ea-4c30-94aa-7cbd1cce6c9a"
Expand All @@ -12,13 +12,10 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
NLPModels = "a4795742-8479-5a88-8948-cc11e1c8c1a6"

[weakdeps]
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
MadNLP = "2621e9c9-9eb4-46b1-8089-e8c72242dfb6"
NLPModelsIpopt = "f4238b75-b362-5c4c-b852-0801c9a21d71"

[extensions]
CTDirectExt = ["JLD2", "JSON3"]
CTSolveExtIpopt = ["NLPModelsIpopt"]
CTSolveExtMadNLP = ["MadNLP"]

Expand All @@ -27,8 +24,6 @@ ADNLPModels = "0.8"
CTBase = "0.14"
DocStringExtensions = "0.9"
HSL = "0.4"
JLD2 = "0.5" # NB. warnings for functions
JSON3 = "1"
MadNLP = "0.8"
NLPModels = "0.21"
NLPModelsIpopt = "0.10"
Expand Down
6 changes: 1 addition & 5 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@ CTDirect = "790bbbee-bee9-49ee-8912-a9de031322d5"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterMermaid = "a078cd44-4d9c-4618-b545-3ab9d77f9177"
HSL = "34c5aeac-e683-54a6-a0e9-6e0fdc586c50"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
NLPModelsIpopt = "f4238b75-b362-5c4c-b852-0801c9a21d71"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"

[compat]
CTBase = "0.14"
CTDirect = "0.13"
CTDirect = "0.14"
Documenter = "1"
DocumenterMermaid = "0.1"
HSL = "0.4"
JLD2 = "0.5" # warnings for functions
JSON3 = "1"
NLPModelsIpopt = "0.10"
Plots = "1"
2 changes: 0 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ using CTBase

using NLPModelsIpopt
using HSL
using JLD2
using JSON3
using Plots

# to add docstrings from external packages
Expand Down
5 changes: 0 additions & 5 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,3 @@ Modules = [CTDirect]
Order = [:module, :constant, :type, :function, :macro]
Private = false
```

```@docs
export_ocp_solution
import_ocp_solution
```
65 changes: 0 additions & 65 deletions ext/CTDirectExt.jl

This file was deleted.

2 changes: 0 additions & 2 deletions src/CTDirect.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export available_methods
export is_solvable
export direct_transcription
export set_initial_guess
export export_ocp_solution
export import_ocp_solution
export direct_solve

end
209 changes: 0 additions & 209 deletions src/ctbase.jl

This file was deleted.

2 changes: 1 addition & 1 deletion src/solution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function CTBase.OptimalControlSolution(docp::DOCP, docp_solution)
objective = objective,
iterations = docp_solution.iter,
constraints_violation = docp_solution.primal_feas,
message = String(docp_solution.solver_specific[:internal_msg]),
message = String(docp_solution.solver_specific[:internal_msg][1]),
mult_LB = docp_solution.multipliers_L,
mult_UB = docp_solution.multipliers_U,
)
Expand Down
4 changes: 0 additions & 4 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,3 @@ function build_bounds(dim_var, dim_box, box_triplet)
return x_lb, x_ub
end


# placeholders (see CTDirectExt) +++ can be removed if functions moved to ctbase
function export_ocp_solution end
function import_ocp_solution end
4 changes: 0 additions & 4 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[deps]
CTBase = "54762871-cc72-4466-b8e8-f6c8b58076cd"
HSL = "34c5aeac-e683-54a6-a0e9-6e0fdc586c50"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MadNLP = "2621e9c9-9eb4-46b1-8089-e8c72242dfb6"
NLPModelsIpopt = "f4238b75-b362-5c4c-b852-0801c9a21d71"
Expand All @@ -13,8 +11,6 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[compat]
CTBase = "0.14"
HSL = "0.4"
JLD2 = "0.5"
JSON3 = "1"
MadNLP = "0.8"
NLPModelsIpopt = "0.10"
SplitApplyCombine = "1"
Expand Down
2 changes: 0 additions & 2 deletions test/deps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ using NLPModelsIpopt
using MadNLP
using SplitApplyCombine # for flatten in some tests

using JLD2 # to be moved to CTBase ?
using JSON3 # to be moved to CTBase ?
Loading

0 comments on commit 77f7fa8

Please sign in to comment.