Closed iSoron closed 2 years ago
Hi @martinbiel, thank you for writing such a nice package.
Currently StochasticPrograms.jl fails when the user calls JuMP.shadow_price(constr, scenario_index) with the error below:
JuMP.shadow_price(constr, scenario_index)
test_solve: Error During Test at /home/axavier/Packages/StochasticPrograms.jl/pr/test/decisions/solve.jl:198 Test threw exception Expression: -1.0 == #= /home/axavier/Packages/StochasticPrograms.jl/pr/test/decisions/solve.jl:198 =# @inferred(JuMP.shadow_price(c, 1)) UndefVarError: shadow_price_less_than_ not defined Stacktrace: [1] shadow_price(sp_cref::SPConstraintRef{MathOptInterface.ConstraintIndex{AffineDecisionFunction{Float64}, MathOptInterface.LessThan{Float64}}, ScalarShape}, scenario_index::Int64) @ StochasticPrograms ~/Packages/StochasticPrograms.jl/pr/src/types/decision_constraint.jl:751 [2] test_solve(Structure::Deterministic, mockoptimizer::MathOptInterface.Utilities.MockOptimizer{MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}, master_optimizer::MathOptInterface.Utilities.MockOptimizer{MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}, subproblem_optimizer::MathOptInterface.Utilities.MockOptimizer{MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}) @ Main.TestSolve ~/Packages/StochasticPrograms.jl/pr/test/decisions/solve.jl:198 [3] macro expansion @ ~/Packages/StochasticPrograms.jl/pr/test/decisions/solve.jl:215 [inlined] [4] macro expansion @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [5] macro expansion @ ~/Packages/StochasticPrograms.jl/pr/test/decisions/solve.jl:215 [inlined] [6] macro expansion @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [7] macro expansion @ ~/Packages/StochasticPrograms.jl/pr/test/decisions/solve.jl:209 [inlined] [8] macro expansion @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined] [9] runtests() @ Main.TestSolve ~/Packages/StochasticPrograms.jl/pr/test/decisions/solve.jl:205
The issue is that some internal JuMP functions have been renamed in d9f5835b. This PR adds a failing test for the problem and fixes it.
Superseded by #43.
Hi @martinbiel, thank you for writing such a nice package.
Currently StochasticPrograms.jl fails when the user calls
JuMP.shadow_price(constr, scenario_index)
with the error below:The issue is that some internal JuMP functions have been renamed in d9f5835b. This PR adds a failing test for the problem and fixes it.