Add JET.jl static analysis tests#430
Closed
ChrisRackauckas-Claude wants to merge 1 commit intoSciML:mainfrom
Closed
Add JET.jl static analysis tests#430ChrisRackauckas-Claude wants to merge 1 commit intoSciML:mainfrom
ChrisRackauckas-Claude wants to merge 1 commit intoSciML:mainfrom
Conversation
Add JET.jl as a test dependency and create targeted static analysis tests for utility functions in the package. Due to the heavy metaprogramming with @component and @connector macros, full package analysis is not feasible. Instead, we test specific utility functions: - Hydraulic utility functions (regPow, transition, friction_factor) - Blocks source functions (smooth_step, smooth_xH, square, triangular) - Electrical digital logic operations (_and2, _or2, _not, _xor2) These tests use JET.@test_opt to verify type stability of the tested functions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
baggepinnen
reviewed
Jan 8, 2026
| # JET.jl static analysis tests for ModelingToolkitStandardLibrary | ||
| # | ||
| # Note: This package heavily uses ModelingToolkit's @component and @connector macros | ||
| # which generate code at macro expansion time. Full package analysis with JET times out. |
Contributor
There was a problem hiding this comment.
# which generate code at macro expansion time. Full package analysis with JET times out.
times out for whom? 😅
Member
|
This is being deprecated anyways |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@test_optDetails
This PR adds JET.jl static analysis tests to the test suite. Due to the heavy metaprogramming with
@componentand@connectormacros, full package analysis with JET is not feasible (times out). Instead, we use a targeted approach testing specific utility functions:Tested Functions
Hydraulic utilities (
IsothermalCompressible):regPow- regularized power functiontransition- smooth transition between valuesfriction_factor- pipe flow friction factor calculationBlocks source functions:
smooth_step- smooth step functionsmooth_xH- smooth ramp helpersquare- square wave generatortriangular- triangular wave generatorElectrical digital logic:
_and2,_or2,_not,_xor2- logic operationsAll 19 tests pass locally.
Test Plan
test/jet.jllocally - passes (19/19 tests)cc @ChrisRackauckas
Generated with Claude Code