Skip to content

Fix deprecation warnings#148

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

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

Conversation

@ChrisRackauckas-Claude
Copy link
Contributor

Summary

  • Remove __precompile__() call (no-op since Julia 1.8, modules precompile by default)
  • Replace removed warn() function calls with @warn macro in dict_build.jl (warn was removed from Base in Julia 1.0)
  • Fix build_param_list returning undefined variable param_dict instead of param_list
  • Fix typo "my be" → "may be" in warning message
  • Remove commented-out dead code using deprecated lufact() API (old Jacobian LU factorization code that used SymEngine.Basic)

Details

While no deprecation warnings are currently emitted at runtime (tests pass with --depwarn=error), the codebase contained usage of APIs that have been removed from Julia:

  1. warn() function (removed in Julia 1.0, replaced by @warn macro): Used in build_indvar_dict and build_param_list in dict_build.jl. These code paths would cause UndefVarError if reached.

  2. __precompile__(): Deprecated since Julia 1.8. All modules precompile by default now.

  3. build_param_list bug: The function returned param_dict (undefined) instead of param_list. This function is currently unused but was broken.

  4. Commented-out code with lufact(): Dead code from the SymEngine era using lufact() (renamed to lu in Julia 1.0) and Matrix{SymEngine.Basic}.

Upstream dependencies note

No upstream dependency changes needed. All current MTK v11 APIs used (tosymbol, generate_rhs, generate_tgrad, generate_jacobian, generate_factorized_W, System) work without deprecation warnings.

The test_undefined_exports Aqua test remains broken = true due to MTK v11 exporting Variable and find_solvables! which are undefined — this is an upstream MTK issue.

Test plan

  • Tests pass with julia --depwarn=error (direct invocation)
  • Tests pass with Pkg.test()
  • Runic formatting check passes

🤖 Generated with Claude Code

- Remove `__precompile__()` call (no-op since Julia 1.8, modules precompile
  by default)
- Replace removed `warn()` function with `@warn` macro in dict_build.jl
  (`warn` was removed from Base in Julia 1.0)
- Fix `build_param_list` returning undefined `param_dict` instead of
  `param_list`
- Fix typo "my be" -> "may be" in warning message
- Remove commented-out dead code using deprecated `lufact()` API
  (Jacobian LU factorization code that used SymEngine.Basic)

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