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

PSSE parser to accept 'blanks' for transformer K parameter? #843

Open
manuelma opened this issue Sep 8, 2022 · 3 comments
Open

PSSE parser to accept 'blanks' for transformer K parameter? #843

manuelma opened this issue Sep 8, 2022 · 3 comments

Comments

@manuelma
Copy link

manuelma commented Sep 8, 2022

In transformer blocks, the K parameter indicates the bus to which the third winding is connected. If the transformer is only two-windings, the parameter should be zero but somehow I got myself a .raw file where the value is simple ommited as seen below:

1021, 10204, ,1, , , , , , , 'XXXX' , 1, 2   / load
0.007, 0.367, 9999
0.9777, ,0, 9999, 9999, 63, 1, 10204, 1.034, 0.72, 1.09, 1.04, 16, , , 
 , ,

So to be correct, the first line should be more like 1021, 10204, 0,1, ...

When I try to parse, I get the below

ERROR: ArgumentError: input string is empty or only contains whitespace
Stacktrace:
  [1] tryparse_internal(#unused#::Type{Int64}, s::SubString{String}, startpos::Int64, endpos::Int64, base_::Int64, raise::Bool)
    @ Base ./parse.jl:109
  [2] parse(::Type{Int64}, s::SubString{String}; base::Nothing)
    @ Base ./parse.jl:241
  [3] parse
    @ ./parse.jl:241 [inlined]
  [4] _parse_pti_data(data_io::FilteredIO)
    @ PowerModels ~/.julia/packages/PowerModels/kU7PK/src/io/pti.jl:708
  [5] parse_pti(io::FilteredIO)
    @ PowerModels ~/.julia/packages/PowerModels/kU7PK/src/io/pti.jl:890
  [6] #parse_psse#1230
    @ ~/.julia/packages/PowerModels/kU7PK/src/io/psse.jl:866 [inlined]
  [7] parse_psse
    @ ~/.julia/packages/PowerModels/kU7PK/src/io/psse.jl:865 [inlined]
  [8] #9
    @ ~/Codes/spine/Network_Prune/psse_to_spine.jl:40 [inlined]
  [9] open(f::var"#9#11", args::String; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:330
 [10] open
    @ ./io.jl:328 [inlined]
 [11] psse_to_spine(psse_path::String, db_url::String)
    @ Main ~/Codes/spine/Network_Prune/psse_to_spine.jl:38
 [12] top-level scope
    @ REPL[13]:1

which makes sense because of this:

if parse(Int, _get_line_elements(line)[1][3]) == 0 # two winding transformer

The question is, should the parser handle empty values for the K parameter as if they were zero, so my file would pass?

@ccoffrin
Copy link
Member

ccoffrin commented Sep 8, 2022

@manuelma, thanks for your bug reports. Can you check what the header of your .raw file says the format version is? So far we have only supported v33, so newer raw files may have features that are un-tested or break our parser.

In this case, it is probably likely that we can support it but I'll need to test the possible fix.

@DillonJ
Copy link

DillonJ commented Sep 12, 2022

Hi folks… here is a link to a zip archive that contains the raw files in question : https://www.eirgridgroup.com/site-files/library/EirGrid/Study-files.zip

@manuelma
Copy link
Author

Thank you @ccoffrin for the help and @DillonJ for the files. I can't see any information regarding the format version in the files, though... @ccoffrin I could submit a PR if that helps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants