Skip to content

[FileFormats.SDPA] reader cannot read https://github.com/vsdp/SDPLIB #2758

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

Closed
odow opened this issue May 19, 2025 · 1 comment · Fixed by #2759
Closed

[FileFormats.SDPA] reader cannot read https://github.com/vsdp/SDPLIB #2758

odow opened this issue May 19, 2025 · 1 comment · Fixed by #2759
Labels
Submodule: FileFormats About the FileFormats submodule

Comments

@odow
Copy link
Member

odow commented May 19, 2025

julia> using JuMP

julia> import Downloads

julia> file = "mcp124-1.dat-s"
"mcp124-1.dat-s"

julia> dir = mktempdir()
"/var/folders/bg/dzq_hhvx1dxgy6gb5510pxj80000gn/T/jl_HX9kEb"

julia> filename = joinpath(dir, file)
"/var/folders/bg/dzq_hhvx1dxgy6gb5510pxj80000gn/T/jl_HX9kEb/mcp124-1.dat-s"

julia> Downloads.download(
           "https://raw.githubusercontent.com/vsdp/SDPLIB/refs/heads/master/data/$file",
           filename,
       )
"/var/folders/bg/dzq_hhvx1dxgy6gb5510pxj80000gn/T/jl_HX9kEb/mcp124-1.dat-s"

julia> model = read_from_file(filename)
ERROR: ArgumentError: cannot parse "{+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0e+00}" as Float64
Stacktrace:
  [1] _parse_failure(T::Type, s::SubString{String}, startpos::Int64, endpos::Int64)
    @ Base ./parse.jl:387
  [2] #tryparse_internal#528
    @ ./parse.jl:383 [inlined]
  [3] tryparse_internal
    @ ./parse.jl:380 [inlined]
  [4] parse
    @ ./parse.jl:393 [inlined]
  [5] _broadcast_getindex_evalf
    @ ./broadcast.jl:709 [inlined]
  [6] _broadcast_getindex
    @ ./broadcast.jl:692 [inlined]
  [7] getindex
    @ ./broadcast.jl:636 [inlined]
  [8] macro expansion
    @ ./broadcast.jl:1004 [inlined]
  [9] macro expansion
    @ ./simdloop.jl:77 [inlined]
 [10] copyto!
    @ ./broadcast.jl:1003 [inlined]
 [11] copyto!
    @ ./broadcast.jl:956 [inlined]
 [12] copy
    @ ./broadcast.jl:928 [inlined]
 [13] materialize
    @ ./broadcast.jl:903 [inlined]
 [14] read!(io::IOStream, model::MathOptInterface.Utilities.GenericModel{…})
    @ MathOptInterface.FileFormats.SDPA ~/.julia/packages/MathOptInterface/98sse/src/FileFormats/SDPA/SDPA.jl:402
 [15] #11
    @ ~/.julia/packages/MathOptInterface/98sse/src/FileFormats/FileFormats.jl:150 [inlined]
 [16] open(::MathOptInterface.FileFormats.var"#11#12"{}, ::String, ::Vararg{…}; kwargs::@Kwargs{})
    @ Base ./io.jl:396
 [17] open
    @ ./io.jl:393 [inlined]
 [18] compressed_open
    @ ~/.julia/packages/MathOptInterface/98sse/src/FileFormats/utils.jl:282 [inlined]
 [19] compressed_open(f::MathOptInterface.FileFormats.var"#11#12"{}, filename::String, mode::String, ::MathOptInterface.FileFormats.AutomaticCompression)
    @ MathOptInterface.FileFormats ~/.julia/packages/MathOptInterface/98sse/src/FileFormats/utils.jl:320
 [20] read_from_file(model::MathOptInterface.Utilities.GenericModel{…}, filename::String)
    @ MathOptInterface.FileFormats ~/.julia/packages/MathOptInterface/98sse/src/FileFormats/FileFormats.jl:149
 [21] read_from_file(filename::String; format::MathOptInterface.FileFormats.FileFormat, kwargs::@Kwargs{})
    @ JuMP ~/.julia/dev/JuMP/src/file_formats.jl:282
 [22] read_from_file(filename::String)
    @ JuMP ~/.julia/dev/JuMP/src/file_formats.jl:276
 [23] top-level scope
    @ REPL[308]:1
Some type information was truncated. Use `show(err)` to see complete types.

shell> cat /var/folders/bg/dzq_hhvx1dxgy6gb5510pxj80000gn/T/jl_HX9kEb/mcp124-1.dat-s
 124
 1
 124
{+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0,+1.0e+00}
0 1 1 1 0.250000
0 1 1 87 -0.250000
0 1 2 2 0.500000
0 1 2 45 -0.250000
0 1 2 67 -0.250000
0 1 3 3 0.250000
0 1 3 8 -0.250000
@odow odow added the Submodule: FileFormats About the FileFormats submodule label May 19, 2025
@odow
Copy link
Member Author

odow commented May 19, 2025

x-ref #1789

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Submodule: FileFormats About the FileFormats submodule
Development

Successfully merging a pull request may close this issue.

1 participant