Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ julia = "1.10"

[extras]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
ParameterizedFunctions = "65888b18-ceab-5e60-b2b9-181511a3b968"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Expand All @@ -70,4 +71,4 @@ SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["ADTypes", "Test", "Pkg", "OrdinaryDiffEq", "ParameterizedFunctions", "SafeTestsets", "StatsBase", "SteadyStateDiffEq"]
test = ["ADTypes", "JET", "Test", "Pkg", "OrdinaryDiffEq", "ParameterizedFunctions", "SafeTestsets", "StatsBase", "SteadyStateDiffEq"]
4 changes: 2 additions & 2 deletions src/dynamichmc_inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $(FIELDS)
Base.@kwdef struct DynamicHMCPosterior{TA, TP, TD, TT, TR, TS, TK, TI, TRe}
"Algorithm for the ODE solver."
algorithm::TA
"An ODE problem definition (`DiffEqBase.DEProblem`)."
"A problem definition (`DiffEqBase.DEProblem` or `DiffEqBase.AbstractNonlinearProblem`)."
problem::TP
"Time values at which the simulated path is compared to `data`."
t::TT
Expand Down Expand Up @@ -102,7 +102,7 @@ posterior values (transformed from `ℝⁿ`).
- `mcmc_kwargs` are passed on as keyword arguments to `DynamicHMC.mcmc_with_warmup`
"""
function dynamichmc_inference(
problem::DiffEqBase.DEProblem, algorithm, t, data,
problem::Union{DiffEqBase.DEProblem, DiffEqBase.AbstractNonlinearProblem}, algorithm, t, data,
parameter_priors,
parameter_transformations = as(
Vector, asℝ₊,
Expand Down
6 changes: 3 additions & 3 deletions src/stan_inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ end

struct StanODEData end

function generate_priors(n, priors)
function generate_priors(n::Integer, priors)
priors_string = ""
if priors === nothing
for i in 1:n
Expand All @@ -27,7 +27,7 @@ function generate_priors(n, priors)
return priors_string
end

function generate_theta(n, priors)
function generate_theta(n::Integer, priors)
theta = ""
for i in 1:n
upper_bound = ""
Expand Down Expand Up @@ -55,7 +55,7 @@ function generate_theta(n, priors)
end

function stan_inference(
prob::DiffEqBase.DEProblem,
prob::Union{DiffEqBase.DEProblem, DiffEqBase.AbstractNonlinearProblem},
alg,
# Positional arguments
t,
Expand Down
2 changes: 1 addition & 1 deletion src/turing_inference.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function turing_inference(
prob::DiffEqBase.DEProblem,
prob::Union{DiffEqBase.DEProblem, DiffEqBase.AbstractNonlinearProblem},
alg,
t,
data,
Expand Down
10 changes: 10 additions & 0 deletions test/jet.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using DiffEqBayes
using JET
using Test

@testset "JET static analysis" begin
@testset "Package-level analysis" begin
result = JET.report_package("DiffEqBayes"; target_modules = (DiffEqBayes,))
@test length(JET.get_reports(result)) == 0
end
end
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ if GROUP == "Stan" || GROUP == "All"
include("stan.jl")
end
end

if GROUP == "JET" || GROUP == "All"
@time @safetestset "JET" begin
include("jet.jl")
end
end
Loading