Skip to content
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: remove zero-padding for storage gen table #100

Merged
merged 1 commit into from
Jan 29, 2021

Conversation

danielolsen
Copy link
Contributor

Purpose

Fix bug for storage introduced in Breakthrough-Energy/PowerSimData#363.

What is the code doing

Previously, we had specified only the 21 'input' columns of the mpc.gen format, not the 'output' ones (mu_Pmin, mu_Pmax, mu_Qmin, mu_Qmax). This may have been an artifact of the MATPOWER/MOST days. Therefore, we had to zero-pad these columns to merge the storage gen table with the main gen table.

In Breakthrough-Energy/PowerSimData#363, we start adding these columns in the case_storage.mat files that we produce, so now the zero-padding creates a dimension mismatch which causes an error in save_input_mat. We remove the zero-padding and now everything works again.

Testing

Before, scenario 2124 fails with error:

ERROR: ArgumentError: number of columns of each array must match (got (25, 29))
Stacktrace:
 [1] _typed_vcat(::Type{Float64}, ::Tuple{Array{Float64,2},Array{Float64,2}}) at ./abstractarray.jl:1439
 [2] typed_vcat at ./abstractarray.jl:1453 [inlined]
 [3] vcat(::Array{Float64,2}, ::Array{Float64,2}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/SparseArrays/src/sparsevector.jl:1077
 [4] save_input_mat(::REISE.Case, ::REISE.Storage, ::String, ::String) at /home/bes/pcm/REISE.jl/src/save.jl:35
 [5] run_scenario(; num_segments::Int64, interval::Int64, n_interval::Int64, start_index::Int64, inputfolder::String, outputfolder::Nothing, threads::Nothing) at /home/bes/pcm/REISE.jl/src/REISE.jl:54
 [6] top-level scope at REPL[2]:1

After, the scenario runs properly.

Time to review

5 minutes.

@danielolsen danielolsen added the bug Something isn't working label Jan 29, 2021
@danielolsen danielolsen self-assigned this Jan 29, 2021
Copy link
Collaborator

@BainanXia BainanXia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another one!

@danielolsen danielolsen merged commit ff3016f into develop Jan 29, 2021
@danielolsen danielolsen deleted the daniel/fix_storage_dims branch January 29, 2021 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants