Skip to content

Commit 1b509e3

Browse files
committed
Detect dat-s extension as SDPA
1 parent 9cc15f4 commit 1b509e3

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/FileFormats/FileFormats.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ function Model(
7777
(".lp", LP.Model),
7878
(".mof.json", MOF.Model),
7979
(".mps", MPS.Model),
80+
(".dat-s", SDPA.Model),
8081
(".sdpa", SDPA.Model)
8182
]
8283
if endswith(filename, ext) || occursin("$(ext).", filename)

test/FileFormats/SDPA/SDPA.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function test_write_then_read(model_string::String)
4949
end
5050

5151
function test_read(filename::String, model_string::String)
52-
model1 = SDPA.Model()
52+
model1 = MOI.FileFormats.Model(filename = filename)
5353
MOIU.loadfromstring!(model1, model_string)
5454
(variable_names, constraint_names) = set_var_and_con_names(model1)
5555

@@ -108,7 +108,7 @@ end
108108
MOI.add_variable(model)
109109
err = ErrorException("Cannot read in file because model is not empty.")
110110
@test_throws err MOI.read_from_file(model,
111-
joinpath(SDPA_MODELS_DIR, "example_A.sdpa"))
111+
joinpath(SDPA_MODELS_DIR, "example_A.dat-s"))
112112
end
113113

114114
@testset "Bad number of blocks" begin
@@ -190,7 +190,7 @@ write_read_models = [
190190
end
191191

192192
example_models = [
193-
("example_A.sdpa", """
193+
("example_A.dat-s", """
194194
variables: x, y
195195
minobjective: 10x + 20y
196196
c1: [x + -1, 0, x + -2] in PositiveSemidefiniteConeTriangle(2)

test/FileFormats/SDPA/models/example_A.sdpa renamed to test/FileFormats/SDPA/models/example_A.dat-s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"Example from http://plato.asu.edu/ftp/sdpa_format.txt
22
"A sample problem.
3-
2
4-
2
3+
2 =mdim
4+
2 =nblocks
55
2 2
66
10.0 20.0
77
0 1 1 1 1.0

0 commit comments

Comments
 (0)