-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Description
Having a separation between the index type VariableIndex and the function type SingleVariable is nice in principle but it's not the best for usability and causes confusions like #1380.
As VariableIndex
has no supertype, it could simply be AbstractScalarFunction
and we won't need SingleVariable
.
The deprecation path doesn't seem too bad, we can do
const SingleVariable = VariableIndex
function VariableIndex(vi::VariableIndex)
@warn "SingleVariable is deprecated"
return vi
end
I always end up having to convert between VariableIndex
and SingleVariable
and it's a difference of behavior with JuMP that makes it difficult to write a code that works both for JuMP and MOI model as JuMP has VariableRef that works both as the reference and the function while in MOI we have two different things.