CompatHelper: bump compat for Turing to 0.40, (keep existing compat)#358
Conversation
93f51ee to
e9d979a
Compare
Fix for Turing 0.40 CompatibilityI've identified and fixed the issue causing CI failures with Turing 0.40. Root Cause
SolutionChanged all inference function signatures from: function *_inference(prob::DiffEqBase.DEProblem, ...)To: function *_inference(prob::SciMLBase.AbstractSciMLProblem, ...)This accepts both Files Modified
TestingAll Turing tests now pass (14/14) with Turing 0.40.5:
The commit with these fixes is ready but I don't have push access to this branch. The maintainers can either:
🤖 Generated with Claude Code |
Patch File AvailableFor easy application of the fix, here's a one-liner to apply the changes: # Apply the essential code changes only (4 files)
git apply << 'PATCH'
diff --git a/src/abc_inference.jl b/src/abc_inference.jl
index 5b5f47b..0b7ccb8 100644
--- a/src/abc_inference.jl
+++ b/src/abc_inference.jl
@@ -24,7 +24,7 @@ function createabcfunction(prob, t, distancefunction, alg; save_idxs = nothing,
end
end
-function abc_inference(prob::DiffEqBase.DEProblem, alg, t, data, priors; ϵ = 0.001,
+function abc_inference(prob::SciMLBase.AbstractSciMLProblem, alg, t, data, priors; ϵ = 0.001,
distancefunction = euclidean, ABCalgorithm = ABCSMC,
progress = false,
num_samples = 500, maxiterations = 10^5, save_idxs = nothing,
diff --git a/src/dynamichmc_inference.jl b/src/dynamichmc_inference.jl
index 540add5..164fea1 100644
--- a/src/dynamichmc_inference.jl
+++ b/src/dynamichmc_inference.jl
@@ -98,7 +98,7 @@ posterior values (transformed from `ℝⁿ`).
- `solve_kwargs` is passed on to `solve`
- `mcmc_kwargs` are passed on as keyword arguments to `DynamicHMC.mcmc_with_warmup`
"""
-function dynamichmc_inference(problem::DiffEqBase.DEProblem, algorithm, t, data,
+function dynamichmc_inference(problem::SciMLBase.AbstractSciMLProblem, algorithm, t, data,
parameter_priors,
parameter_transformations = as(Vector, asℝ₊,
length(parameter_priors));
diff --git a/src/stan_inference.jl b/src/stan_inference.jl
index fb42c5c..208b319 100644
--- a/src/stan_inference.jl
+++ b/src/stan_inference.jl
@@ -52,7 +52,7 @@ function generate_theta(n, priors)
end
function stan_inference(
- prob::DiffEqBase.DEProblem,
+ prob::SciMLBase.AbstractSciMLProblem,
alg,
# Positional arguments
t,
diff --git a/src/turing_inference.jl b/src/turing_inference.jl
index a204a06..0c11a78 100644
--- a/src/turing_inference.jl
+++ b/src/turing_inference.jl
@@ -1,5 +1,5 @@
function turing_inference(
- prob::DiffEqBase.DEProblem,
+ prob::SciMLBase.AbstractSciMLProblem,
alg,
t,
data,
PATCHJust change 🤖 Generated with Claude Code |
CI Failure Analysis and FixThe CI was failing because of a breaking change in Turing 0.40 that affected the type hierarchy for Root Cause
This caused a Fix AppliedChanged the function signature in function turing_inference(
prob::DiffEqBase.DEProblem,to: function turing_inference(
prob::SciMLBase.AbstractSciMLProblem,This broader type signature supports both Test ResultsAfter the fix:
Required ActionA maintainer with write permissions needs to apply this one-line change or I can create a separate PR with the fix if preferred. 🤖 Generated with Claude Code |
Update: Local Fix AvailableI've created a local branch
The fix is ready and tested locally (Turing tests now pass 14/14). However, I don't have push access to create a PR from this branch. For a maintainer to merge this:
The change is minimal and safe - it just broadens the type signature to support the new type hierarchy in Turing 0.40. 🤖 Generated with Claude Code |
|
The fix has been opened as a separate PR: #359 This PR includes both the Turing 0.40 compat bump and the necessary code fix to handle the type hierarchy change for 🤖 Generated with Claude Code |
|
This PR is superseded by #359 which was already merged. PR #359 included both the Turing 0.40 compat bump and the necessary code fixes for compatibility. The changes from this CompatHelper PR are now part of master. Closing this PR. 🤖 Generated with Claude Code |
This pull request changes the compat entry for the
Turingpackage from0.38, 0.39to0.38, 0.39, 0.40.This keeps the compat entries for earlier versions.
Note: I have not tested your package with this new compat entry.
It is your responsibility to make sure that your package tests pass before you merge this pull request.