Skip to content

Commit

Permalink
Remove JSON from deps, relpace by JSON3
Browse files Browse the repository at this point in the history
  • Loading branch information
ykharkov committed Mar 4, 2024
1 parent 7e25a9b commit b089884
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Missings = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
Expand All @@ -24,10 +23,11 @@ Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
Parsers = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"

[compat]
ArgParse = "=1.1.5"
CSV = "=0.10.12"
CSV = "0.10"
DataFrames = "1.6"
Plots = "1.30"
CairoMakie = "0.5"
Expand All @@ -37,7 +37,6 @@ Missings = "1.1"
DataStructures = "=0.18.15"
Dates = "1.6"
InteractiveUtils = "1.6"
JSON = "=0.21.0"
JSON3 = "=1.14.0"
Logging = "1.6"
Markdown = "1.10"
Expand All @@ -46,3 +45,4 @@ Statistics = "1.6"
Test = "1.6"
UUIDs = "1.6"
julia = "1.6"
Parsers = "1, 2"
4 changes: 2 additions & 2 deletions src/ahs_program.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ end


json_str = JSON3.write(ir(ahs_program))
json_obj = JSON.parse(json_str)
json_obj = JSON3.read(json_str)

# Define the file path
file_path = "examples/ahs_program.json"

# Write the JSON object to a file
open(file_path, "w") do file
JSON.print(file, json_obj, 4) # The '4' here is for pretty printing with an indent of 4 spaces
JSON3.write(file, json_obj) # The '4' here is for pretty printing with an indent of 4 spaces
end

4 changes: 2 additions & 2 deletions src/mps_runner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using Dates
using Missings
using Random
using Logging
using JSON
using JSON3

include("mps_utils.jl")
include("plotter.jl")
Expand Down Expand Up @@ -81,7 +81,7 @@ experiment_path = args["experiment-path"]
program_path = args["program-path"]

@info "JSON file to read: $program_path"
ahs_json = JSON.parsefile(program_path)
ahs_json = JSON3.read(read(program_path, String), Dict{String, Any})

results = run(ahs_json, args)

Expand Down
4 changes: 2 additions & 2 deletions src/mps_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using Dates
using Base.Filesystem
using Missings
using Random
using JSON
using JSON3


"""
Expand Down Expand Up @@ -189,7 +189,7 @@ function parse_ahs_program(ahs_json, args::Dict{String, Any})
end

# Serialize the data to a JSON-formatted string, write the JSON string to the file
write(joinpath(experiment_path, "ahs_program.json"), JSON.json(ahs_json))
write(joinpath(experiment_path, "ahs_program.json"), JSON3.read(ahs_json))
# Write filling data to CSV file
CSV.write(joinpath(experiment_path, "filling.csv"), DataFrame(filling', :auto))

Expand Down

0 comments on commit b089884

Please sign in to comment.