-
Notifications
You must be signed in to change notification settings - Fork 13
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
FIx depreciation warnings + more #4
base: master
Are you sure you want to change the base?
Conversation
See Updating to be compatible with latest versions of Julia/JuMP/JuMPChance mlubin#3 Updating for Julia 0.5.0, JuMPChance 0.3.0 and JuMP 0.14.1. fix al the depreciation warnings fix with_probability
@@ -15,7 +15,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI | |||
# Define packages to be used: | |||
using JuMP # Optimization package | |||
using JuMPChance # Chance constraints package | |||
using Gurobi # Solver, could be altered if needed | |||
# using Gurobi # Solver, could be altered if needed | |||
using Mosek # Solver, could be altered if needed |
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.
This change should stay local, no reason to change the solver from what we used in the paper
Everything here appears correct. The problem is infeasible with this code? |
Sorry for the CPLEX code in the pull request, I just wanted to share some The console output for that code + my installed packages below:
|
Were you able to successfully run the original code with the listed versions of the packages? |
no, I got stuck at the following error in Julia 0.4.6 - JuMP 0.9.0 - ERROR: LoadError: Cannot construct an affine expression with a term of type console dump + pkg list below: electa-05:run fgeth$ WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: module JuMP should explicitly import setindex! from Base WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: module JuMP should explicitly import setindex! from Base WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: module JuMP should explicitly import setindex! from Base WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: module JuMP should explicitly import setindex! from Base WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: module JuMP should explicitly import setindex! from Base WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: module JuMP should explicitly import setindex! from Base WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: module JuMP should explicitly import setindex! from Base WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: module JuMP should explicitly import setindex! from Base WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: module JuMP should explicitly import setindex! from Base WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: module JuMP should explicitly import setindex! from Base WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: module JuMP should explicitly import setindex! from Base reading config bpa-season1-gamma1.0.dat WARNING: beginswith is deprecated, use startswith instead. in depwarn at deprecated.jl:73 in beginswith at deprecated.jl:30 in readconfig at in include at in include_from_node1 at in process_options at in _start at while loading WARNING: beginswith is deprecated, use startswith instead. in depwarn at deprecated.jl:73 in beginswith at deprecated.jl:30 in readconfig at in include at in include_from_node1 at in process_options at in _start at while loading WARNING: int(s::AbstractString) is deprecated, use parse(Int,s) instead. in depwarn at deprecated.jl:73 in int at deprecated.jl:50 in readconfig at in include at in include_from_node1 at in process_options at in _start at while loading
WARNING: int(x::AbstractFloat) is deprecated, use round(Int,x) instead. in depwarn at deprecated.jl:73 in int at deprecated.jl:50 in readcase at in include at in include_from_node1 at in process_options at in _start at while loading ROBUST CCOPF with budget 1.0 10 time steps node 27 is farm 1 node 18 is farm 2 node 23 is farm 3 node 24 is farm 4 node 18 is farm 5 node 907 is farm 6 node 970 is farm 7 node 1040 is farm 8 node 1384 is farm 9 node 22 is farm 10 node 25 is farm 11 node 2186 is farm 12 node 1121 is farm 13 node 1394 is farm 14 node 1390 is farm 15 node 1400 is farm 16 node 21 is farm 17 node 18 is farm 18 node 31 is farm 19 node 31 is farm 20 node 25 is farm 21 node 24 is farm 22 node 970 is farm 23 node 1413 is farm 24 WARNING: deprecated syntax "{}" at Use "[]" instead. WARNING: deprecated syntax "{}" at Use "[]" instead. WARNING: deprecated syntax "{}" at Use "[]" instead. WARNING: deprecated syntax "{}" at Use "[]" instead. WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.Uint8 is deprecated, use UInt8 instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near ######## T = 1 -> sumvar 6615.7132128661 stddev 81.33703469432666 WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: iround(x) is deprecated, use round(Integer,x) instead. in depwarn at deprecated.jl:73 in iround at deprecated.jl:50 in solve_ccopf at [inlined code] from in anonymous at no file:0 in include at in include_from_node1 at in process_options at in _start at while loading WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near in ChanceModel#0 at WARNING: Base.String is deprecated, use AbstractString instead. likely near in ChanceModel#0 at WARNING: Base.String is deprecated, use AbstractString instead. likely near in ChanceModel#0 at WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near in Model#0 at /Users/fgeth/.julia/v0.4/JuMP/src/JuMP.jl WARNING: Base.String is deprecated, use AbstractString instead. likely near in Model#0 at /Users/fgeth/.julia/v0.4/JuMP/src/JuMP.jl WARNING: Base.String is deprecated, use AbstractString instead. likely near in Model#0 at /Users/fgeth/.julia/v0.4/JuMP/src/JuMP.jl WARNING: Base.String is deprecated, use AbstractString instead. likely near in Model#0 at /Users/fgeth/.julia/v0.4/JuMP/src/JuMP.jl WARNING: Base.String is deprecated, use AbstractString instead. likely near in Model#0 at /Users/fgeth/.julia/v0.4/JuMP/src/JuMP.jl WARNING: Base.String is deprecated, use AbstractString instead. likely near in Model#0 at /Users/fgeth/.julia/v0.4/JuMP/src/JuMP.jl WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near WARNING: Base.String is deprecated, use AbstractString instead. likely near ERROR: LoadError: Cannot construct an affine expression with a term of type in error at [inlined code] from in solve_ccopf at [inlined code] from in anonymous at no file:0 in include at in include_from_node1 at in process_options at in _start at while loading * _ ****()*** | A fresh approach to technical ()* | **()* (_)* | Documentation: http://docs.julialang.org
|__/ | x86_64-apple-darwin13.4.0 _julia> _Pkg.status() 3 required packages:
19 additional packages:
On Thu, Sep 22, 2016 at 4:34 PM, Miles Lubin [email protected]
|
That's quite strange. I should have a chance to look into this over the weekend. |
I'm using Mac OS 10.11.6 btw, and latest versions of Gurobi/CPLEX, any Thank you again for your time (I hope I'm not wasting it on some trivial On Thu, Sep 22, 2016 at 4:53 PM, Miles Lubin [email protected]
|
I think the infeasible issue is that the sense of the chance constraints also need to be flipped with the change from epsilon to 1-epsilon. We used to say that constraints are violated with small probability, now we say that they're satisfied with high probability. Could you give this a try? |
Per recommendation of Miles in mlubin#4 , the direction of the chance constraints was swapped. Some additional deprecation warnings were fixed
Thanks Miles, changing the sense of the chance constraints fixed the feasibility issue. However, as I still can't run the original code, I'm not able to quickly verify the correctness. Do you have some reference output stored somewhere?
|
I can confirm the objective values match up. Could you update the required versions as listed in the README? Feel free to give yourself credit for updating the code as well. After that I'm ready to merge. |
Ok, I'll do that sometime this week. However, in its current state, on my mac at least, the .mat export fails (corrupt file and filename contains a newline after the extension). I'm still trying to find out what's wrong there in between things. |
I can reproduce this too. It turns out you need to replace the import Base.close
function close(f::MAT.MAT_HDF5.MatlabHDF5File)
if f.toclose
close(f.plain)
if f.writeheader
magic = zeros(UInt8, 512)
const identifier = "MATLAB 7.3 MAT-file" # minimal but sufficient
magic[1:length(identifier)] = identifier.data
magic[126] = 0x02
magic[127] = 0x49
magic[128] = 0x4d
rawfid = open(f.plain.filename, "w") # change from "r+" to "w"
write(rawfid, magic)
close(rawfid)
end
f.toclose = false
end
nothing
end Feel free to submit an upstream issue at https://github.com/simonster/MAT.jl/issues. |
See
Updating to be compatible with latest versions of Julia/JuMP/JuMPChance
#3
Updating for Julia 0.5.0, JuMPChance 0.3.0 and JuMP 0.14.1.
fix al the depreciation warnings
fix with_probability