Skip to content

Commit d495923

Browse files
committed
drop JSON1 and 2
1 parent 4ac23b2 commit d495923

File tree

6 files changed

+9
-12
lines changed

6 files changed

+9
-12
lines changed

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
1818
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1919
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
2020
FunctionalStateMachine = "3e9e306e-7e3c-11e9-12d2-8f8f67a2f951"
21-
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
22-
JSON2 = "2535ab7d-5cd8-5a07-80ac-9b1792aadce3"
2321
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
2422
KernelDensityEstimate = "2472808a-b354-52ea-a80e-1658a3c6056d"
2523
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/IncrementalInference.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ using Dates,
4141
ProgressMeter,
4242
DocStringExtensions,
4343
FunctionalStateMachine,
44-
JSON2,
4544
JSON3,
4645
Combinatorics,
4746
UUIDs,

src/Serialization/services/SerializationMKD.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ end
7575
function Base.convert(::Type{String}, mkd::ManifoldKernelDensity)
7676
#
7777
packedMKD = packDistribution(mkd)
78-
return JSON2.write(packedMKD)
78+
return JSON3.write(packedMKD)
7979
end
8080

8181
# Use general dispatch
@@ -86,7 +86,7 @@ end
8686
# https://discourse.julialang.org/t/converting-string-to-datatype-with-meta-parse/33024/2
8787
# https://discourse.julialang.org/t/is-there-a-way-to-import-modules-with-a-string/15723/6
8888
function Base.convert(::Type{<:ManifoldKernelDensity}, str::AbstractString)
89-
dtr = JSON2.read(str, PackedManifoldKernelDensity)
89+
dtr = JSON3.read(str, PackedManifoldKernelDensity)
9090
return unpackDistribution(dtr)
9191
end
9292

src/Serialization/services/SerializingDistributions.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,18 +170,18 @@ end
170170
# FIXME ON FIRE, must deprecate nested JSON written fields in all serialization
171171
# TODO is string necessary, because unpacking templated e.g. PackedType{T} has problems, see DFG #668
172172
function convert(::Type{String}, dtr::StringThemSamplableBeliefs)
173-
return JSON2.write(packDistribution(dtr))
173+
return JSON3.write(packDistribution(dtr))
174174
end
175175

176176
function convert(::Type{<:SamplableBelief}, str_obj::AbstractString)
177177
#
178178

179179
# go from stringified to generic packed (no type info)
180-
_pck = JSON2.read(str_obj)
180+
_pck = JSON3.read(str_obj)
181181
# NOTE, get the packed type from strong assumption that field `_type` exists in the
182-
T = DFG.getTypeFromSerializationModule(_pck[:_type])
182+
T = DFG.getTypeFromSerializationModule(_pck._type)
183183
# unpack again to described packedType
184-
pckT = JSON2.read(str_obj, T)
184+
pckT = JSON3.read(str_obj, T)
185185

186186
# unpack to regular <:SamplableBelief
187187
return unpackDistribution(pckT)

src/services/FGOSUtils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ Fetch and unpack JSON dictionary stored as a data blob.
606606
function fetchDataJSON(dfg::AbstractDFG, varsym::Symbol, lbl::Symbol)
607607
gde, rawData = getData(dfg, varsym, lbl)
608608
if gde.mimeType == "application/json/octet-stream"
609-
JSON2.read(IOBuffer(rawData))
609+
JSON3.read(IOBuffer(rawData))
610610
else
611611
error("Unknown JSON Blob format $(gde.mimeType)")
612612
end

test/testPackingMixtures.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
using IncrementalInference
44
using DistributedFactorGraphs
5-
using JSON
5+
# using JSON
66

77

88
##
@@ -27,7 +27,7 @@ pf = packFactor(fg, getFactor(fg, :x0x1f1))
2727

2828
##
2929

30-
pf_ = JSON.json(pf)
30+
pf_ = JSON3.write(pf)
3131

3232

3333
##

0 commit comments

Comments
 (0)