Electa-Git / PowerModelsACDC.jl

A hybrid AC/DC OPF package based on PowerModels.jl
BSD 3-Clause "New" or "Revised" License
52 stars 20 forks source link

Error in `add_candidate_dcgrid!` when adding candidate converters to existing DC buses #70

Closed matteorossini closed 2 years ago

matteorossini commented 2 years ago

When adding a candidate converter to an existing DC bus, the add_candidate_dcgrid! function raises an

ERROR: LoadError: MethodError: no method matching push!(::Dict{Int64, Vector{Any}}, ::Int64)

at this line: https://github.com/Electa-Git/PowerModelsACDC.jl/blob/8ef219296223306a53e976005bad9ab788cb0171/src/core/base.jl#L222

I suppose that line needs to be changed to

        push!(bus_convs_dc_ne[conv["busdc_i"]], i)

similarly to the case of adding candidate converters to candidate DC buses:

https://github.com/Electa-Git/PowerModelsACDC.jl/blob/8ef219296223306a53e976005bad9ab788cb0171/src/core/base.jl#L230