Skip to content

Add JET static analysis tests and type annotations#364

Merged
ChrisRackauckas merged 2 commits intoSciML:masterfrom
ChrisRackauckas-Claude:static-improvements-20260103-064345
Jan 5, 2026
Merged

Add JET static analysis tests and type annotations#364
ChrisRackauckas merged 2 commits intoSciML:masterfrom
ChrisRackauckas-Claude:static-improvements-20260103-064345

Conversation

@ChrisRackauckas-Claude
Copy link

Summary

  • Add JET.jl as a test dependency
  • Add JET test in test/jet.jl to verify package has no static analysis issues
  • Add ::Integer type annotation to generate_priors and generate_theta functions in stan_inference.jl
  • Add "JET" test group to test/runtests.jl

Details

JET analysis confirms DiffEqBayes has 0 issues when filtering to target module only (using target_modules=(DiffEqBayes,)). All 388 issues in the initial unfiltered report were from dependencies like StanSample, SymbolicUtils, AbstractPPL, etc.

The type annotations added are conservative - only adding ::Integer where the function clearly expects an integer count. These help with static analysis without over-constraining the code.

Test plan

  • JET test passes (ENV["GROUP"]="JET" Pkg.test())
  • Core tests pass (13/14, the 1 error is a pre-existing upstream issue with SteadyStateProblem not being a subtype of AbstractDEProblem)

Note: The pre-existing test failure in test/turing.jl for SteadyStateProblem is unrelated to these changes and exists on master.

cc @ChrisRackauckas

🤖 Generated with Claude Code

claude added 2 commits January 5, 2026 05:49
- Add JET.jl as a test dependency
- Add JET test in test/jet.jl to verify package has no static analysis issues
- Add `::Integer` type annotation to `generate_priors` and `generate_theta` functions
- Add "JET" test group to runtests.jl

JET analysis confirms DiffEqBayes has 0 issues when filtering to target module only.
(All 388 issues in initial report were from dependencies like StanSample, SymbolicUtils, etc.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change DEProblem type annotation to Union{DEProblem, AbstractNonlinearProblem}
in turing_inference, dynamichmc_inference, and stan_inference functions.

SteadyStateProblem is a subtype of AbstractNonlinearProblem, not DEProblem,
so the previous type restriction was too narrow. This fixes the test failure
for SteadyStateProblem in test/turing.jl.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChrisRackauckas-Claude ChrisRackauckas-Claude force-pushed the static-improvements-20260103-064345 branch from ba43780 to 15e380e Compare January 5, 2026 11:07
@ChrisRackauckas-Claude
Copy link
Author

Additional Changes

Rebased on master and added a fix for the SteadyStateProblem type restriction issue.

Changes in this update:

  1. Rebased onto latest master - Now includes the Runic.jl formatting changes from PR Switch from JuliaFormatter to Runic.jl for code formatting #365.

  2. Fixed type restriction for SteadyStateProblem - Changed prob::DiffEqBase.DEProblem to prob::Union{DiffEqBase.DEProblem, DiffEqBase.AbstractNonlinearProblem} in:

    • turing_inference (src/turing_inference.jl)
    • dynamichmc_inference (src/dynamichmc_inference.jl)
    • stan_inference (src/stan_inference.jl)

This fixes the pre-existing test failure where SteadyStateProblem was not a subtype of DEProblem. SteadyStateProblem is a subtype of AbstractNonlinearProblem, which is a sibling of AbstractDEProblem in the type hierarchy (both are subtypes of AbstractSciMLProblem).

All Turing tests now pass including the SteadyStateProblem test case.

🤖 Generated with Claude Code

@ChrisRackauckas ChrisRackauckas merged commit 713d9d0 into SciML:master Jan 5, 2026
5 of 10 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