Skip to content

Commit

Permalink
fix Pigeons.JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
UBCYujia committed Jun 16, 2024
1 parent d230b14 commit 43487c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Expect = "6a31a4e8-6e70-5a2d-b005-bc2d500d80a5"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LogDensityProblems = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c"
LogDensityProblemsAD = "996a588d-648d-4e1f-a8f0-a84b347e47b1"
Expand Down
1 change: 1 addition & 0 deletions src/Pigeons.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ using ZipFile
using ForwardDiff
using LogDensityProblems
using LogDensityProblemsAD
using JSON

import Serialization.serialize
import Serialization.deserialize
Expand Down
10 changes: 3 additions & 7 deletions src/targets/StanLogPotential.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ $SIGNATURES
Create a JSON string based on the scalar or array variables
provided.
"""
json(; variables...) =
"{" *
join(
map(
pair -> "\"$(pair[1])\" : $(pair[2])",
collect(variables)), ",") *
"}"


json(; variables...) = JSON.json(Dict(pairs(variables)))

0 comments on commit 43487c1

Please sign in to comment.