Skip to content

Commit 6baf87b

Browse files
nsicchaclaude
andcommitted
Make JSON a direct dep, remove JSONExt
bridgestan_data and prepare_for_stan are now in the main module. JSON compat is already wide (0.18-1.x). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a8d8c25 commit 6baf87b

4 files changed

Lines changed: 3 additions & 8 deletions

File tree

Project.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ version = "0.1.5"
55

66
[deps]
77
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
8+
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
89
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
910
LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
1011
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
@@ -13,7 +14,6 @@ TestModules = "63c02187-99fd-4e5c-aaf0-4d6bfebc181c"
1314

1415
[weakdeps]
1516
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
16-
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1717
LogDensityProblems = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c"
1818
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
1919
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
@@ -23,7 +23,6 @@ StanLogDensityProblems = "a545de4d-8dba-46db-9d34-4e41d3f07807"
2323

2424
[extensions]
2525
DifferentiationInterfaceExt = "DifferentiationInterface"
26-
JSONExt = "JSON"
2726
LogDensityProblemsExt = "LogDensityProblems"
2827
MarkdownExt = "Markdown"
2928
MooncakeExt = "Mooncake"

ext/JSONExt.jl

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/StanBlocks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export @stan, @model, @parameters, @transformed_parameters, @generated_quantitie
44
export @slic, @defsig, @deffun
55
export stan_code, stan_model, stan_instantiate
66

7-
using LinearAlgebra, Statistics, Distributions, LogExpFunctions
7+
using LinearAlgebra, Statistics, Distributions, LogExpFunctions, JSON
88

99
include("wrapper.jl")
1010
include("macros.jl")

src/slic_stan/slic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ prepare_for_stan(x::AbstractVector{<:Number}) = x
862862
prepare_for_stan(x::AbstractMatrix{<:Number}) = x'
863863
prepare_for_stan(x::NamedTuple) = prepare_for_stan(values(x))
864864
prepare_for_stan(x::Tuple) = prepare_for_stan(Dict(enumerate(x)))
865-
bridgestan_data(args...; kwargs...) = error("Using bridgestan_data requires loading JSON.jl!")
865+
bridgestan_data(x::Dict) = JSON.json(prepare_for_stan(x))
866866
"""
867867
Returns the StanLogDensityProblem (a compiled posterior).
868868

0 commit comments

Comments
 (0)