From a90defcab3d9b1d9db676c747a3cb2a64b230733 Mon Sep 17 00:00:00 2001 From: Johannes Terblanche Date: Fri, 3 Mar 2023 13:45:29 +0200 Subject: [PATCH] Upgrades to drop JSON3 dependancy in DFG --- Project.toml | 2 ++ src/IncrementalInference.jl | 3 ++- src/Serialization/services/SerializingDistributions.jl | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index d173328f..e3ffc679 100644 --- a/Project.toml +++ b/Project.toml @@ -20,6 +20,7 @@ FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" FunctionalStateMachine = "3e9e306e-7e3c-11e9-12d2-8f8f67a2f951" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" JSON2 = "2535ab7d-5cd8-5a07-80ac-9b1792aadce3" +JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" KernelDensityEstimate = "2472808a-b354-52ea-a80e-1658a3c6056d" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" @@ -58,6 +59,7 @@ FileIO = "1" FunctionalStateMachine = "0.2.9" JSON = "0.21" JSON2 = "0.3" +JSON3 = "1" KernelDensityEstimate = "0.5.6" Manifolds = "0.8.15" ManifoldsBase = "0.13.12, 0.14" diff --git a/src/IncrementalInference.jl b/src/IncrementalInference.jl index a1fbf359..9fc48c55 100644 --- a/src/IncrementalInference.jl +++ b/src/IncrementalInference.jl @@ -41,7 +41,8 @@ using Dates, ProgressMeter, DocStringExtensions, FunctionalStateMachine, - JSON2, + JSON2, + JSON3, Combinatorics, UUIDs, TensorCast diff --git a/src/Serialization/services/SerializingDistributions.jl b/src/Serialization/services/SerializingDistributions.jl index 7a4a263e..86258c93 100644 --- a/src/Serialization/services/SerializingDistributions.jl +++ b/src/Serialization/services/SerializingDistributions.jl @@ -160,7 +160,7 @@ function convert(::Type{<:PackedSamplableBelief}, obj::StringThemSamplableBelief end convert(::Type{<:SamplableBelief}, obj::PackedSamplableBelief) = unpackDistribution(obj) -function convert(::Type{<:PackedSamplableBelief}, nt::NamedTuple) +function convert(::Type{<:PackedSamplableBelief}, nt::Union{NamedTuple, JSON3.Object}) distrType = DFG.getTypeFromSerializationModule(nt._type) return distrType(; nt...) end