Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/api_reference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ function generate_api_reference(src_dir::String, ext_dir::String)
title_in_menu="Solvers",
filename="solvers",
),

]

# ───────────────────────────────────────────────────────────────────
Expand Down
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ include("api_reference.jl")
# Build documentation
# ═══════════════════════════════════════════════════════════════════════════════
with_api_reference(src_dir, ext_dir) do api_pages
makedocs(;
return makedocs(;
draft=draft,
remotes=nothing, # Disable remote links. Needed for DocumenterReference
warnonly=true,
Expand Down
4 changes: 3 additions & 1 deletion ext/CTSolversADNLPModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ function Modelers.build_adnlp_modeler(
if haskey(kwargs, :adnlp_backend)
@warn "adnlp_backend is deprecated, use backend instead" maxlog=1
end
opts = Strategies.build_strategy_options(Modelers.ADNLP{parameter}; mode=mode, kwargs...)
opts = Strategies.build_strategy_options(
Modelers.ADNLP{parameter}; mode=mode, kwargs...
)
return Modelers.ADNLP{parameter}(opts)
end

Expand Down
2 changes: 1 addition & 1 deletion ext/CTSolversIpopt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module CTSolversIpopt

import DocStringExtensions: TYPEDSIGNATURES
import CTSolvers.Solvers
import CommonSolve
using CommonSolve: CommonSolve
import CTBase.Strategies
import CTBase.Options
import CTBase.Core
Expand Down
2 changes: 1 addition & 1 deletion ext/CTSolversKnitro.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module CTSolversKnitro

import DocStringExtensions: TYPEDSIGNATURES
import CTSolvers.Solvers
import CommonSolve
using CommonSolve: CommonSolve
import CTBase.Strategies
import CTBase.Options
import CTBase.Exceptions
Expand Down
2 changes: 1 addition & 1 deletion ext/CTSolversMadNCL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module CTSolversMadNCL

import DocStringExtensions: TYPEDSIGNATURES
import CTSolvers.Solvers
import CommonSolve
using CommonSolve: CommonSolve
import CTBase.Strategies
import CTBase.Options
import CTBase.Core
Expand Down
2 changes: 1 addition & 1 deletion ext/CTSolversMadNLP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module CTSolversMadNLP
import DocStringExtensions: TYPEDSIGNATURES
import CTSolvers.Optimization
import CTSolvers.Solvers
import CommonSolve
using CommonSolve: CommonSolve
import CTBase.Strategies
import CTBase.Options
import CTBase.Core
Expand Down
2 changes: 1 addition & 1 deletion ext/CTSolversUno.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module CTSolversUno

import DocStringExtensions: TYPEDSIGNATURES
import CTSolvers.Solvers
import CommonSolve
using CommonSolve: CommonSolve
import CTBase.Strategies
import CTBase.Options
import CTBase.Core
Expand Down
2 changes: 1 addition & 1 deletion src/DOCP/contract.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ concrete type, e.g. `CTSolvers.discretize(ocp, ::Collocation)` in CTDirect.
See also: `build_model`, `build_solution`.
"""
function discretize(ocp::CTModels.AbstractModel, discretizer::AbstractDiscretizer)
throw(
return throw(
Exceptions.NotImplemented(
"discretize not implemented";
required_method="CTSolvers.discretize(ocp, ::$(typeof(discretizer)))",
Expand Down
4 changes: 1 addition & 3 deletions src/DOCP/discretized_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ multiple dispatch on `(DiscretizedModel, modeler)` through the `build_model` /
See also: `ocp_model`, `discretize`, `build_model`, `build_solution`.
"""
struct DiscretizedModel{
TO<:CTModels.AbstractModel,
TD<:AbstractDiscretizer,
TC<:Core.AbstractCache,
TO<:CTModels.AbstractModel,TD<:AbstractDiscretizer,TC<:Core.AbstractCache
} <: AbstractOptimizationProblem
ocp::TO
discretizer::TD
Expand Down
10 changes: 5 additions & 5 deletions src/Modelers/adnlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ See also: [`CTSolvers.Modelers.get_adnlp_available_backends`](@ref),
[`CTSolvers.Modelers.ADNLPTag`](@ref)
"""
function __get_adnlp_available_backends(::Type{<:Core.AbstractTag})
throw(
return throw(
Exceptions.ExtensionError(
:ADNLPModels;
message="to list available ADNLP backends",
Expand Down Expand Up @@ -227,8 +227,8 @@ $(TYPEDSIGNATURES)
Return the description for the ADNLP modeler.
"""
function Strategies.description(::Type{<:Modelers.ADNLP})
"NLP modeler using ADNLPModels with automatic differentiation.\n" *
"See: https://jso.dev/ADNLPModels.jl"
return "NLP modeler using ADNLPModels with automatic differentiation.\n" *
"See: https://jso.dev/ADNLPModels.jl"
end

"""
Expand Down Expand Up @@ -259,7 +259,7 @@ Stub — real implementation provided by the CTSolversADNLPModels extension.
See also: `Modelers.ADNLP`, `Strategies.StrategyMetadata`
"""
function Strategies.metadata(::Type{<:Modelers.ADNLP{P}}) where {P<:CPU}
throw(
return throw(
Exceptions.ExtensionError(
:ADNLPModels;
message="to access ADNLP{$P} options metadata",
Expand Down Expand Up @@ -320,7 +320,7 @@ See also: `Modelers.ADNLP`, `Strategies.metadata`
function build_adnlp_modeler(
::Type{<:Core.AbstractTag}, parameter::Type{<:AbstractStrategyParameter}; kwargs...
)
throw(
return throw(
Exceptions.ExtensionError(
:ADNLPModels;
message="to create ADNLP, access options, and build NLP models",
Expand Down
8 changes: 5 additions & 3 deletions src/Modelers/contract.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ generic stub throws [`CTBase.Exceptions.NotImplemented`](@extref).
See also: `Optimization.build_solution`, `Optimization.BuiltModel`.
"""
function Optimization.build_model(
prob::Optimization.AbstractOptimizationProblem, initial_guess, modeler::AbstractNLPModeler
prob::Optimization.AbstractOptimizationProblem,
initial_guess,
modeler::AbstractNLPModeler,
)
throw(
return throw(
Exceptions.NotImplemented(
"Model building not implemented";
required_method="Optimization.build_model(prob::$(typeof(prob)), initial_guess, modeler::$(typeof(modeler)))",
Expand Down Expand Up @@ -84,7 +86,7 @@ See also: `Optimization.build_model`, `Optimization.BuiltModel`.
function Optimization.build_solution(
built::Optimization.BuiltModel, model_solution, modeler::AbstractNLPModeler
)
throw(
return throw(
Exceptions.NotImplemented(
"Solution building not implemented";
required_method="Optimization.build_solution(built::BuiltModel{$(typeof(built.problem))}, model_solution, modeler::$(typeof(modeler)))",
Expand Down
10 changes: 5 additions & 5 deletions src/Modelers/exa.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ and returns an appropriate CUDA backend.
- Uses CUDA.CUDABackend() for GPU execution
"""
function __get_cuda_backend(::Type{<:GPU})
throw(
return throw(
Exceptions.ExtensionError(
:CUDA;
message="to use GPU backend with Exa modeler",
Expand Down Expand Up @@ -237,8 +237,8 @@ $(TYPEDSIGNATURES)
Return the description for the Exa modeler.
"""
function Strategies.description(::Type{<:Modelers.Exa})
"NLP modeler using ExaModels, supporting CPU and GPU execution.\n" *
"See: https://exanauts.github.io/ExaModels.jl"
return "NLP modeler using ExaModels, supporting CPU and GPU execution.\n" *
"See: https://exanauts.github.io/ExaModels.jl"
end

"""
Expand Down Expand Up @@ -269,7 +269,7 @@ Stub — real implementation provided by the CTSolversExaModels extension.
See also: `Modelers.Exa`, `Strategies.StrategyMetadata`
"""
function Strategies.metadata(::Type{<:Modelers.Exa{P}}) where {P<:Union{CPU,GPU}}
throw(
return throw(
Exceptions.ExtensionError(
:ExaModels;
message="to access Exa{$P} options metadata",
Expand Down Expand Up @@ -340,7 +340,7 @@ See also: `Modelers.Exa`, `Strategies.metadata`
function build_exa_modeler(
::Type{<:Core.AbstractTag}, parameter::Type{<:AbstractStrategyParameter}; kwargs...
)
throw(
return throw(
Exceptions.ExtensionError(
:ExaModels;
message="to create Exa, access options, and build NLP models",
Expand Down
10 changes: 5 additions & 5 deletions src/Modelers/validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ See also: `validate_adnlp_backend(::Core.AbstractTag, ::Val{:default})`, `get_va
"""
function validate_adnlp_backend(tag::Core.AbstractTag, backend::Val)
# This is the generic fallback - should never be reached
throw(
return throw(
Exceptions.IncorrectArgument(
"Invalid ADNLPModels backend";
got="backend=$(backend)",
Expand Down Expand Up @@ -85,7 +85,7 @@ Validate Enzyme backend using tag dispatch.
See also: `validate_adnlp_backend(::Core.AbstractTag, ::Val{:zygote})`, `get_validate_adnlp_backend`
"""
function validate_adnlp_backend(tag::Core.AbstractTag, ::Val{:enzyme})
throw(
return throw(
Exceptions.ExtensionError(
:Enzyme;
message="to use Enzyme backend with ADNLP modeler",
Expand Down Expand Up @@ -115,7 +115,7 @@ Validate Zygote backend using tag dispatch.
See also: `validate_adnlp_backend(::Core.AbstractTag, ::Val{:enzyme})`, `get_validate_adnlp_backend`
"""
function validate_adnlp_backend(tag::Core.AbstractTag, ::Val{:zygote})
throw(
return throw(
Exceptions.ExtensionError(
:Zygote;
message="to use Zygote backend with ADNLP modeler",
Expand Down Expand Up @@ -182,7 +182,7 @@ Fallback method for invalid base types in ExaModels validation.
See also: `validate_exa_base_type(::Type{<:AbstractFloat})`
"""
function validate_exa_base_type(T)
throw(
return throw(
Exceptions.IncorrectArgument(
"Invalid base type for Modelers.Exa";
got="base_type=$T",
Expand Down Expand Up @@ -351,7 +351,7 @@ function validate_backend_override(backend)
isa(backend, Type) && __is_adbackend_type(backend) && return backend
# Accept an ADBackend instance (e.g., ForwardDiffADGradient())
__is_adbackend_instance(backend) && return backend
throw(
return throw(
Exceptions.IncorrectArgument(
"Backend override must be nothing, a Type{<:ADBackend}, or an ADBackend instance";
got=string(typeof(backend)),
Expand Down
2 changes: 1 addition & 1 deletion src/Solvers/contract.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ the `CTSolversIpopt` extension. This generic stub throws `NotImplemented`.
See also: `AbstractNLPSolver`.
"""
function CommonSolve.solve(nlp, solver::AbstractNLPSolver; display::Bool=__display())
throw(
return throw(
Exceptions.NotImplemented(
"Solve not implemented for this solver";
required_method="CommonSolve.solve(nlp, solver::$(typeof(solver)); display)",
Expand Down
8 changes: 4 additions & 4 deletions src/Solvers/ipopt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ $(TYPEDSIGNATURES)
Return the description for the Ipopt solver.
"""
function Strategies.description(::Type{<:Solvers.Ipopt})
"Interior-point NLP solver (COIN-OR Ipopt).\n" *
"See: https://coin-or.github.io/Ipopt/OPTIONS.html"
return "Interior-point NLP solver (COIN-OR Ipopt).\n" *
"See: https://coin-or.github.io/Ipopt/OPTIONS.html"
end

"""
Expand Down Expand Up @@ -229,7 +229,7 @@ See also: `Ipopt`, `Strategies.metadata`
function build_ipopt_solver(
::Type{<:Core.AbstractTag}, parameter::Type{<:AbstractStrategyParameter}; kwargs...
)
throw(
return throw(
Exceptions.ExtensionError(
:NLPModelsIpopt;
message="to create Ipopt, access options, and solve problems",
Expand All @@ -254,7 +254,7 @@ See also: `Ipopt`, `Strategies.StrategyMetadata`
"""
function Strategies.metadata(::Type{<:Solvers.Ipopt{P}}) where {P<:CPU}
# Extension is missing
throw(
return throw(
Exceptions.ExtensionError(
:NLPModelsIpopt;
message="to access Ipopt{$P} options metadata",
Expand Down
8 changes: 4 additions & 4 deletions src/Solvers/knitro.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ $(TYPEDSIGNATURES)
Return the description for the Knitro solver.
"""
function Strategies.description(::Type{<:Solvers.Knitro})
"Commercial NLP solver by Artelys (requires license).\n" *
"See: https://www.artelys.com/app/docs/knitro/3_referenceManual/userOptions.html"
return "Commercial NLP solver by Artelys (requires license).\n" *
"See: https://www.artelys.com/app/docs/knitro/3_referenceManual/userOptions.html"
end

"""
Expand Down Expand Up @@ -232,7 +232,7 @@ See also: `Knitro`, `Strategies.metadata`
function build_knitro_solver(
::Type{<:Core.AbstractTag}, parameter::Type{<:AbstractStrategyParameter}; kwargs...
)
throw(
return throw(
Exceptions.ExtensionError(
:NLPModelsKnitro;
message="to create Knitro, access options, and solve problems",
Expand All @@ -257,7 +257,7 @@ See also: `Knitro`, `Strategies.StrategyMetadata`
"""
function Strategies.metadata(::Type{<:Solvers.Knitro{P}}) where {P<:CPU}
# Extension is missing
throw(
return throw(
Exceptions.ExtensionError(
:NLPModelsKnitro;
message="to access Knitro{$P} options metadata",
Expand Down
8 changes: 4 additions & 4 deletions src/Solvers/madncl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ $(TYPEDSIGNATURES)
Return the description for the MadNCL solver.
"""
function Strategies.description(::Type{<:Solvers.MadNCL})
"Augmented Lagrangian NLP solver built on MadNLP.\n" *
"See: https://github.com/MadNLP/MadNCL.jl"
return "Augmented Lagrangian NLP solver built on MadNLP.\n" *
"See: https://github.com/MadNLP/MadNCL.jl"
end

"""
Expand Down Expand Up @@ -189,7 +189,7 @@ See also: `MadNCL`, `Strategies.metadata`
function build_madncl_solver(
::Type{<:Core.AbstractTag}, parameter::Type{<:AbstractStrategyParameter}; kwargs...
)
throw(
return throw(
Exceptions.ExtensionError(
:MadNCL,
:MadNLP;
Expand All @@ -216,7 +216,7 @@ See also: `MadNCL`, `Strategies.StrategyMetadata`
function Strategies.metadata(
::Type{<:Solvers.MadNCL{P}}
) where {P<:AbstractStrategyParameter}
throw(
return throw(
Exceptions.ExtensionError(
:MadNCL,
:MadNLP;
Expand Down
8 changes: 4 additions & 4 deletions src/Solvers/madnlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ $(TYPEDSIGNATURES)
Return the description for the MadNLP solver.
"""
function Strategies.description(::Type{<:Solvers.MadNLP})
"Interior-point NLP solver with sparse linear algebra and GPU support.\n" *
"See: https://madsuite.org/MadNLP.jl/stable/options/"
return "Interior-point NLP solver with sparse linear algebra and GPU support.\n" *
"See: https://madsuite.org/MadNLP.jl/stable/options/"
end

"""
Expand Down Expand Up @@ -195,7 +195,7 @@ See also: `MadNLP`, `Strategies.metadata`
function build_madnlp_solver(
::Type{<:Core.AbstractTag}, parameter::Type{<:AbstractStrategyParameter}; kwargs...
)
throw(
return throw(
Exceptions.ExtensionError(
:MadNLP;
message="to create MadNLP, access options, and solve problems",
Expand All @@ -221,7 +221,7 @@ See also: `MadNLP`, `Strategies.StrategyMetadata`
function Strategies.metadata(
::Type{<:Solvers.MadNLP{P}}
) where {P<:AbstractStrategyParameter}
throw(
return throw(
Exceptions.ExtensionError(
:MadNLP;
message="to access MadNLP{$P} options metadata",
Expand Down
2 changes: 1 addition & 1 deletion src/Solvers/madnlpsuite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Return the default linear solver for the given parameter type.
- GPU implementation provided by CTSolversMadNLPGPU extension
"""
function __madnlp_suite_default_linear_solver(::Type{<:GPU})
throw(
return throw(
Exceptions.ExtensionError(
:MadNLPGPU;
message="to use GPU linear solver with MadNLP/MadNCL",
Expand Down
8 changes: 4 additions & 4 deletions src/Solvers/uno.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ $(TYPEDSIGNATURES)
Return the description for the Uno solver.
"""
function Strategies.description(::Type{<:Solvers.Uno})
"Unified modular NLP solver combining interior-point, SQP, trust-region and filter strategies.\n" *
"See: https://unosolver.readthedocs.io/en/latest/"
return "Unified modular NLP solver combining interior-point, SQP, trust-region and filter strategies.\n" *
"See: https://unosolver.readthedocs.io/en/latest/"
end

"""
Expand Down Expand Up @@ -258,7 +258,7 @@ See also: `Uno`, `Strategies.metadata`
function build_uno_solver(
::Type{<:Core.AbstractTag}, parameter::Type{<:AbstractStrategyParameter}; kwargs...
)
throw(
return throw(
Exceptions.ExtensionError(
:UnoSolver;
message="to create Uno, access options, and solve problems",
Expand All @@ -283,7 +283,7 @@ See also: `Uno`, `Strategies.StrategyMetadata`
"""
function Strategies.metadata(::Type{<:Solvers.Uno{P}}) where {P<:CPU}
# Extension is missing
throw(
return throw(
Exceptions.ExtensionError(
:UnoSolver;
message="to access Uno{$P} options metadata",
Expand Down
Loading