Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- version: '1'
os: windows-latest
arch: x64
- version: '1.6'
- version: '1.10'
os: ubuntu-latest
arch: x64
- version: '1'
Expand Down
14 changes: 7 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
CodecBzip2 = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd"
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MutableArithmetics = "d8a4904e-b15c-11e9-3269-09a3773c0cb0"
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
Expand All @@ -23,18 +23,18 @@ BenchmarkTools = "1"
CodecBzip2 = "0.6, 0.7, 0.8"
CodecZlib = "0.6, 0.7"
ForwardDiff = "0.10, 1"
JSON3 = "1"
JSON = "1"
JSONSchema = "1"
LinearAlgebra = "<0.0.1, 1.6"
LinearAlgebra = "1"
MutableArithmetics = "1"
NaNMath = "0.3, 1"
OrderedCollections = "1"
PrecompileTools = "1"
Printf = "<0.0.1, 1.6"
SparseArrays = "<0.0.1, 1.6"
Printf = "1"
SparseArrays = "1"
SpecialFunctions = "0.8, 1, 2"
Test = "<0.0.1, 1.6"
julia = "1.6"
Test = "1"
julia = "1.10"

[extras]
JSONSchema = "7d188eb4-7ad8-530c-ae41-71a32a6d4692"
Expand Down
2 changes: 1 addition & 1 deletion src/FileFormats/MOF/MOF.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
module MOF

import ..FileFormats
import JSON3
import JSON
import MathOptInterface as MOI

"""
Expand Down
2 changes: 1 addition & 1 deletion src/FileFormats/MOF/read.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Base.read!(io::IO, model::Model)
if !MOI.is_empty(model)
error("Cannot read model from file as destination model is not empty.")
end
object = JSON3.read(io, Dict{String,Any})
object = JSON.parse(io; dicttype = Dict{String,Any})
file_version = _parse_mof_version(object["version"]::Dict{String,Any})
if !(file_version in _SUPPORTED_VERSIONS)
version = _SUPPORTED_VERSIONS[1]
Expand Down
2 changes: 1 addition & 1 deletion src/FileFormats/MOF/write.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function Base.write(io::IO, model::Model)
if has_scalar_nonlinear
object = (; has_scalar_nonlinear = true, object...)
end
JSON3.write(io, object)
Base.write(io, JSON.json(object))
return
end

Expand Down
11 changes: 7 additions & 4 deletions test/FileFormats/MOF/MOF.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module TestMOF

using Test

import JSON3
import JSON
import JSONSchema
import MathOptInterface as MOI

Expand All @@ -17,7 +17,10 @@ const MOF = MOI.FileFormats.MOF
const TEST_MOF_FILE = "test.mof.json"

const SCHEMA = JSONSchema.Schema(
JSON3.read(read(MOI.FileFormats.MOF.SCHEMA_PATH, String), Dict{String,Any}),
JSON.parse(
read(MOI.FileFormats.MOF.SCHEMA_PATH, String);
dicttype = Dict{String,Any},
),
)

function runtests()
Expand All @@ -40,7 +43,7 @@ function _validate(filename::String)
"r",
MOI.FileFormats.AutomaticCompression(),
) do io
object = JSON3.read(io, Dict{String,Any})
object = JSON.parse(io; dicttype = Dict{String,Any})
ret = JSONSchema.validate(SCHEMA, object)
if ret !== nothing
error(
Expand Down Expand Up @@ -1565,7 +1568,7 @@ function test_use_nlp_block()
io = IOBuffer()
write(io, model)
seekstart(io)
object = JSON3.read(io, Dict{String,Any})
object = JSON.parse(io; dicttype = Dict{String,Any})
@test object["has_scalar_nonlinear"] == true
@test JSONSchema.validate(SCHEMA, object) === nothing
# Test (; use_nlp_block = nothing)
Expand Down
Loading