diff --git a/src/constraints.jl b/src/constraints.jl index 57d87434..93ac4581 100644 --- a/src/constraints.jl +++ b/src/constraints.jl @@ -62,7 +62,7 @@ function __constraint!( codim_f::Union{Dimension,Nothing}=nothing, ) - # checkings: the constraint must not be set before + # checks: the constraint must not be set before @ensure( !(label ∈ keys(ocp_constraints)), CTBase.UnauthorizedCall( @@ -70,7 +70,7 @@ function __constraint!( ), ) - # checkings: lb and ub cannot be both nothing + # checks: lb and ub cannot be both nothing @ensure( !(isnothing(lb) && isnothing(ub)), CTBase.UnauthorizedCall( @@ -217,7 +217,7 @@ function constraint!( codim_f::Union{Dimension,Nothing}=nothing, ) - # checkings: times, state and control must be set before adding constraints + # checks: times, state and control must be set before adding constraints @ensure __is_state_set(ocp) CTBase.UnauthorizedCall( "the state must be set before adding constraints." ) @@ -228,7 +228,7 @@ function constraint!( "the times must be set before adding constraints." ) - # checkings: variable must be set if using type=:variable + # checks: variable must be set if using type=:variable @ensure (type != :variable || __is_variable_set(ocp)) CTBase.UnauthorizedCall( "the ocp has no variable, you cannot use constraint! function with type=:variable. If it is a mistake, please set the variable first.", ) diff --git a/src/control.jl b/src/control.jl index fa90e168..864f26c2 100644 --- a/src/control.jl +++ b/src/control.jl @@ -46,7 +46,7 @@ function control!( components_names::Vector{T2}=__control_components(m, string(name)), )::Nothing where {T1<:Union{String,Symbol},T2<:Union{String,Symbol}} - # checkings using @ensure + # checks using @ensure @ensure !__is_control_set(ocp) CTBase.UnauthorizedCall( "the control has already been set." ) diff --git a/src/objective.jl b/src/objective.jl index d330def1..a884490b 100644 --- a/src/objective.jl +++ b/src/objective.jl @@ -35,7 +35,7 @@ function objective!( lagrange::Union{Function,Nothing}=nothing, )::Nothing - # checkings: times, state, and control must be set before the objective + # checks: times, state, and control must be set before the objective @ensure __is_state_set(ocp) CTBase.UnauthorizedCall( "the state must be set before the objective." ) @@ -46,12 +46,12 @@ function objective!( "the times must be set before the objective." ) - # checkings: the objective must not already be set + # checks: the objective must not already be set @ensure !__is_objective_set(ocp) CTBase.UnauthorizedCall( "the objective has already been set." ) - # checkings: at least one of the two functions must be given + # checks: at least one of the two functions must be given @ensure !(isnothing(mayer) && isnothing(lagrange)) CTBase.IncorrectArgument( "at least one of the two functions must be given. Please provide a Mayer or a Lagrange function.", ) diff --git a/src/state.jl b/src/state.jl index 9dec903a..18682d3a 100644 --- a/src/state.jl +++ b/src/state.jl @@ -60,7 +60,7 @@ function state!( components_names::Vector{T2}=__state_components(n, string(name)), )::Nothing where {T1<:Union{String,Symbol},T2<:Union{String,Symbol}} - # checkings + # checks @ensure !__is_state_set(ocp) CTBase.UnauthorizedCall("the state has already been set.") @ensure n > 0 CTBase.IncorrectArgument("the state dimension must be greater than 0") @ensure size(components_names, 1) == n CTBase.IncorrectArgument( diff --git a/test/Project.toml b/test/Project.toml index ca62c987..2b721821 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -18,7 +18,7 @@ CTDirect = "0.16" CTParser = "0.6" JLD2 = "0.6" JSON3 = "1" -NLPModelsIpopt = "0.10" +NLPModelsIpopt = "0.11" Plots = "1" Test = "1" julia = "1.10" diff --git a/test/test_control.jl b/test/test_control.jl index 28e338ba..62c8a2cf 100644 --- a/test/test_control.jl +++ b/test/test_control.jl @@ -9,7 +9,7 @@ function test_control() @test CTModels.name(control) == "u" @test CTModels.components(control) == ["u₁", "u₂"] - # some checkings + # some checks ocp = CTModels.PreModel() @test isnothing(ocp.control) @test !CTModels.__is_control_set(ocp) diff --git a/test/test_state.jl b/test/test_state.jl index 00c710e0..da68a3c5 100644 --- a/test/test_state.jl +++ b/test/test_state.jl @@ -9,7 +9,7 @@ function test_state() @test CTModels.name(state) == "y" @test CTModels.components(state) == ["u", "v"] - # some checkings + # some checks ocp = CTModels.PreModel() @test isnothing(ocp.state) @test !CTModels.__is_state_set(ocp) diff --git a/test/test_times.jl b/test/test_times.jl index 29a51030..b1b5d6de 100644 --- a/test/test_times.jl +++ b/test/test_times.jl @@ -15,7 +15,7 @@ function test_times() @test CTModels.name(time) == "s" @test_throws CTBase.IncorrectArgument CTModels.time(time, Float64[]) - # some checkings + # some checks ocp = CTModels.PreModel() @test isnothing(ocp.times) @test !CTModels.__is_times_set(ocp) diff --git a/test/test_variable.jl b/test/test_variable.jl index 3b204773..2ffa86f1 100644 --- a/test/test_variable.jl +++ b/test/test_variable.jl @@ -9,7 +9,7 @@ function test_variable() @test CTModels.name(variable) == "v" @test CTModels.components(variable) == ["v₁", "v₂"] - # some checkings + # some checks ocp = CTModels.PreModel() @test ocp.variable isa CTModels.EmptyVariableModel @test !CTModels.__is_variable_set(ocp)