Skip to content

Fix deprecation warnings#371

Merged
ChrisRackauckas merged 1 commit intoSciML:masterfrom
ChrisRackauckas-Claude:fix-deprecation-warnings
Feb 9, 2026
Merged

Fix deprecation warnings#371
ChrisRackauckas merged 1 commit intoSciML:masterfrom
ChrisRackauckas-Claude:fix-deprecation-warnings

Conversation

@ChrisRackauckas-Claude
Copy link

Summary

  • Fix Symbolics.jl deprecation warning: build_function(::Array{<:Equation}...) is deprecated. Use build_function(::AbstractArray...) instead.
  • Pass RHS expressions ([eq.rhs for eq in equations(sys)]) instead of Equation objects to build_function in stan_inference.jl
  • Update Stan ODE solver integral strings to pass parameters as a vector ([theta_1, theta_2, ...]') instead of individual scalars, matching the new build_function output signature

Details

The deprecated build_function call with Equation objects generated Stan functions with individual real parameters:

vector sho(real t, vector u, real p_1, real p_2) { ... }

The new call with RHS expressions generates Stan functions with a vector parameter:

vector sho(real t, vector u, vector p) { ... }

The Stan ODE solver call (ode_rk45_tol, etc.) is updated to pass a Stan vector [theta_1, theta_2, ...]' to match.

Upstream deprecation notes

  • ParameterizedFunctions.@ode_def triggers a @warn from ModelingToolkit about @independent_variables t — this is upstream in ParameterizedFunctions, not fixable here
  • The CMDSTAN_HOME warning from StanBase is a test environment issue, not a code issue
  • The Turing sample_u0=true test (line 57) is stochastically flaky — it occasionally fails with value ~1e-6 vs expected 1.0, but this is a pre-existing MCMC convergence issue, not related to deprecation

Test plan

  • Core tests (DynamicHMC + Turing) pass with JULIA_DEPWARN=error
  • Stan string tests pass
  • Stan inference tests require CmdStan installation (not available in local env, should pass in CI)

🤖 Generated with Claude Code

Replace deprecated `build_function(::Array{<:Equation}...)` call with the
non-deprecated form that passes RHS expressions directly. The new
`build_function` generates a vector parameter signature instead of
individual scalar parameters, so the Stan ODE solver integral strings
are updated accordingly to pass parameters as a vector.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas merged commit b3bb32e into SciML:master Feb 9, 2026
7 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants