Fix Turing 0.40 compatibility: use AbstractSciMLProblem type#359
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function turing_inference( | ||
| prob::DiffEqBase.DEProblem, | ||
| prob::SciMLBase.AbstractSciMLProblem, |
There was a problem hiding this comment.
Import/add SciMLBase for new type annotation
The new annotation SciMLBase.AbstractSciMLProblem relies on the SciMLBase module being in scope, but this package neither imports SciMLBase nor lists it as a dependency. In a clean environment, SciMLBase will be undefined in DiffEqBayes, so loading the module or parsing this method triggers UndefVarError: SciMLBase not defined. To avoid a load-time failure, add SciMLBase to [deps] and using SciMLBase (or switch to a type that is already in scope).
Useful? React with 👍 / 👎.
SteadyStateProblem is now a subtype of AbstractNonlinearProblem rather than AbstractDEProblem in the SciML ecosystem. Changed the function signature to accept AbstractSciMLProblem which supports both problem types. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
e3d5c3c to
64b32d8
Compare
Summary
turing_inferencefunction signature to acceptSciMLBase.AbstractSciMLProbleminstead ofDiffEqBase.DEProblemSteadyStateProblemis now a subtype ofAbstractNonlinearProblemrather thanAbstractDEProblemRoot Cause
In Turing 0.40 / recent SciML ecosystem changes,
SteadyStateProblemmoved from being a subtype ofAbstractDEProblemtoAbstractNonlinearProblem. Theturing_inferencefunction was typed to only acceptDEProblem, causing aMethodErrorwhen used withSteadyStateProblem.Solution
Changed the type signature from:
to:
This accepts both
AbstractDEProblem(ODE/SDE/etc) andAbstractNonlinearProblem(includingSteadyStateProblem).Related
This supersedes the compat-only change in #358 by including the necessary code fix.
🤖 Generated with Claude Code