Skip to content

Fix deprecation and method redefinition warnings in CI tests#1264

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

Fix deprecation and method redefinition warnings in CI tests#1264
ChrisRackauckas merged 1 commit intoSciML:masterfrom
ChrisRackauckas-Claude:fix-deprecation-warnings

Conversation

@ChrisRackauckas-Claude
Copy link
Contributor

Summary

  • Rename overwritten function definitions to unique names in test files to eliminate WARNING: Method definition overwritten messages (7 files)
  • Add local keyword to disambiguate soft scope assignments in test loops and @test_broken blocks (4 files)
  • Replace deprecated ModelingToolkit APIs: ODESystemSystem, NonlinearSystemSystem, structural_simplifymtkcompile
  • Replace deprecated sol[end] indexing with sol.u[end] for RecursiveArrayTools compatibility
  • Fix function signatures (add missing p parameter) that were previously hidden by method accumulation on shared f generic

Details

Method redefinition warnings fixed

These test files defined multiple functions named f with different signatures, causing WARNING: Method definition f(...) overwritten messages in CI:

  • test/problem_creation_tests.jl — renamed to f_ode, f_2ndorder, f_sde, g_sde, f_dae, f_rode, f_discrete, f_steady
  • test/forwarddiff_dual_detection.jl — renamed to f_nlsolve, f_1021
  • test/downstream/solve_error_handling.jl — renamed to f_oop, f_iip, f_sde
  • test/downstream/community_callback_tests.jl — renamed to collision_affect!, terminate_affect!
  • test/downstream/distributed_ensemble.jl — renamed to simple_prob_func, lorenz_prob_func

Soft scope warnings fixed

  • test/downstream/kwarg_warn.jl — removed unnecessary sol = assignment in @test_throws
  • test/downstream/solve_error_handling.jl — added local in for loop, removed unnecessary assignment
  • test/downstream/null_de.jl — added local in for loop
  • test/downstream/default_linsolve_structure.jl — added local in @test_broken blocks

Deprecated API replacements

  • test/downstream/null_de.jlODESystemSystem, NonlinearSystemSystem, structural_simplifymtkcompile
  • test/downstream/subarray_support.jlsol[end]sol.u[end]

Test plan

  • Core tests pass locally with --depwarn=yes
  • No method redefinition warnings remain in core tests
  • Runic formatting check passes on all changed files
  • CI should pass on all test groups

🤖 Generated with Claude Code

- Rename overwritten function definitions to unique names in test files
  to eliminate "WARNING: Method definition overwritten" messages
- Add `local` keyword to disambiguate soft scope assignments in test
  loops and @test_broken blocks
- Replace deprecated ModelingToolkit APIs: ODESystem -> System,
  NonlinearSystem -> System, structural_simplify -> mtkcompile
- Replace deprecated sol[end] indexing with sol.u[end] for
  RecursiveArrayTools compatibility
- Fix function signatures (add missing `p` parameter) that were
  previously hidden by method accumulation on shared `f` generic

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas merged commit b3342a4 into SciML:master Feb 9, 2026
39 of 46 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