-
Notifications
You must be signed in to change notification settings - Fork 97
Description
I am working on adding support for MOI.ScalarNonlinearFunction to EAGO and I am running into a particular error with some tests.
I cannot provide a MWE since I have not pushed any of my changes yet, but this is how I am running my tests.
import EAGO
import MathOptInterface as MOI
model = MOI.instantiate(
EAGO.Optimizer;
with_bridge_type = Float64,
with_cache_type = Float64,
)
config = MOI.Test.Config(;
atol = 1e-3,
rtol = 1e-3,
exclude = Any[
MOI.DualObjectiveValue,
MOI.ConstraintBasisStatus,
MOI.VariableBasisStatus,
MOI.ConstraintDual,
],
)
MOI.empty!(model)
MOI.Test.test_basic_VectorNonlinearFunction_CountAtLeast(model, config)I have excluded the other tests (which are all test_basic_VectorNonlinearFunction_) in this example, but they all return the same error.
ERROR: MethodError: no method matching filter_variables(::MathOptInterface.Utilities.var"#17#18"{Set{MathOptInterface.VariableIndex}}, ::MathOptInterface.VectorNonlinearFunction)
Closest candidates are:
filter_variables(::F, ::Any, ::Any) where F<:Function
filter_variables(::Function, ::MathOptInterface.VariableIndex)
filter_variables(::Function, ::MathOptInterface.VectorOfVariables)
...
The way I implemented MOI.ScalarNonlinearFunction is similar to Optim.jl https://github.com/JuliaNLSolvers/Optim.jl/blob/658c39a316bda911cddf442702b11bf086f1b5ba/ext/OptimMOIExt.jl
where the functions are added to a MOI.Nonlinear.Model and then used to create a MOI.Nonlinear.Evaluator and MOI.NLPBlockData to continue using the old nonlinear interface.
I am not sure if this issue is because I am not directly storing the functions or something else, but I figured I would check here first for insight before moving forward.
Thanks in advance.