Skip to content

Fix deprecation warnings from ModelingToolkitBase#1395

Merged
ChrisRackauckas merged 3 commits intoSciML:masterfrom
ChrisRackauckas-Claude:fix-deprecation-warnings
Feb 9, 2026
Merged

Fix deprecation warnings from ModelingToolkitBase#1395
ChrisRackauckas merged 3 commits intoSciML:masterfrom
ChrisRackauckas-Claude:fix-deprecation-warnings

Conversation

@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor

Summary

  • Replace deprecated NonlinearSystem(...) constructor with MT.System(...) in ss_ode_model, matching the pattern already used by ode_model and sde_model
  • Update test code that called ODEProblem, NonlinearProblem, and SteadyStateProblem on compiled MTK systems with separate u0 and p arguments to use the merged merge(Dict(u0), Dict(p)) form
  • Update docstrings and error messages that referenced the deprecated NonlinearSystem type

Deprecation warnings fixed

These warnings were appearing in CI logs (visible with --depwarn=yes):

  1. NonlinearSystem(args...; kwargs...) is deprecated, use System(args...; kwargs...) instead — from src/reactionsystem_conversions.jl:850 in ss_ode_model. Fixed by replacing NonlinearSystem(eqs, us, ps; ...) with MT.System(eqs, us, ps; ...).

  2. SciMLBase.ODEProblem(sys, u0, tspan, p; kw...) is deprecated — from test code in component_based_model_creation.jl calling ODEProblem directly on compiled MTK systems with separate u0 and p. Fixed by merging u0 and p into a single dict.

  3. SciMLBase.NonlinearProblem{true}(sys, u0, p; kw...) is deprecated — from test code in conservation_laws.jl. Fixed by merging u0 and p.

  4. SciMLBase.SteadyStateProblem{true}(sys, u0, p; kw...) is deprecated — from test code in conservation_laws.jl. Fixed by merging u0 and p.

Not addressed (upstream)

The alg_eqs keyword deprecation warning in the Hybrid test group originates from inside ModelingToolkitBase's callbacks.jl (AffectSystem constructor) and cannot be fixed on the Catalyst side.

Test plan

  • Smoke test: ss_ode_model returns System type, problem constructors work
  • Simulation test group passes
  • Full Modeling test group (running locally, CI will verify)

🤖 Generated with Claude Code

Replace deprecated `NonlinearSystem(...)` constructor with `MT.System(...)`
in `ss_ode_model`, matching the pattern already used by `ode_model` and
`sde_model`. Update test code that called `ODEProblem`, `NonlinearProblem`,
and `SteadyStateProblem` on compiled MTK systems with separate `u0` and `p`
arguments to use the merged `merge(Dict(u0), Dict(p))` form.

Source changes:
- `ss_ode_model`: `NonlinearSystem(eqs, us, ps; ...)` → `MT.System(eqs, us, ps; ...)`
- `spatial_convert_err` call: `NonlinearSystem` → `MT.System`
- Updated docstrings and error messages referencing `NonlinearSystem`

Test changes:
- `component_based_model_creation.jl`: merge u0/p for direct MTK system calls
- `conservation_laws.jl`: merge u0/p for NonlinearProblem{true} and
  SteadyStateProblem{true} calls on MTK systems

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Comment thread src/reactionsystem.jl Outdated
Comment thread src/reactionsystem.jl Outdated
Comment thread src/reactionsystem_conversions.jl Outdated
Comment thread src/reactionsystem_conversions.jl Outdated
Comment thread src/reactionsystem_conversions.jl Outdated
Copy link
Copy Markdown
Member

@isaacsas isaacsas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming tests pass this looks good to merge.

@ChrisRackauckas ChrisRackauckas merged commit cde0983 into SciML:master Feb 9, 2026
19 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.

4 participants