-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constraint revise #147
Constraint revise #147
Conversation
change functional constraint functions
The new version of constraint!
There is a problem with the documentation. Maybe because of the basic example in functional form. |
I think this does not work in this version (see here): constraint!(ocp, :initial, [ -1, 0 ]) # initial condition
constraint!(ocp, :final, [ 0, 0 ]) # final condition since there is no more constraint!(
ocp::OptimalControlModel,
type::Symbol,
val::Union{Real, AbstractVector{<:Real}}
)
constraint!(
ocp::OptimalControlModel,
type::Symbol,
val::Union{Real, AbstractVector{<:Real}},
label::Symbol
) |
Do we want: function constraint!(ocp::OptimalControlModel,
type::Symbol,
val::ctVector,
label::Symbol=__constraint_label())
__constraint!(ocp, type, rg=nothing, f=nothing, lb=val, ub=val, label=label)
nothing # to force to return nothing
end or since we have: function constraint!(ocp::OptimalControlModel,
type::Symbol,
lb::Union{ctVector,Nothing},
ub::Union{ctVector,Nothing},
label::Symbol=__constraint_label())
__constraint!(ocp, type, rg=nothing, f=nothing, lb=lb, ub=ub, label=label)
nothing # to force to return nothing
end In the first case, we can write constraint!(ocp, :initial, [ 1, 2, 1 ]) while if we do not have the first method then we should write constraint!(ocp, :initial, [ 1, 2, 1 ], [ 1, 2, 1 ]) |
@ocots @BaptisteCbl right, we should check and close it. plus the issue for |
I keep only the method |
@ocots OK 👍🏽 Note that there are indeed consistency checks in the general Line 676 in a7e2023
To me, there should only be some old functional syntax tests to update (some of them are already preventing the doc CI). Then we must also take care of |
….jl into constraint_revise
Up to now there is only one There are indeed consistency checks but I have made more comprehensive the errors in the case of unauthorized calls: Line 623 in 0d936f4
Note that for the unitary tests, I have defined |
I think that constraint are revised (if the CI is ok) and we can make another branch for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ocots is it really the only place where this is used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ocots I see some blue style here, well done 👍🏽 SNCF time 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ocots very nice tests update 👍🏽
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ocots well done 👍🏽👍🏽 rapid test update providing __constraint!
that preserves the old functional style and is mapped (and so tests) the new constraint!
with named args.
Il faut finaliser ça.