Skip to content

Add JET.jl static analysis tests#430

Closed
ChrisRackauckas-Claude wants to merge 1 commit intoSciML:mainfrom
ChrisRackauckas-Claude:static-improvements-20260107-165438
Closed

Add JET.jl static analysis tests#430
ChrisRackauckas-Claude wants to merge 1 commit intoSciML:mainfrom
ChrisRackauckas-Claude:static-improvements-20260107-165438

Conversation

@ChrisRackauckas-Claude
Copy link

Summary

  • Add JET.jl as a test dependency for static analysis testing
  • Create targeted JET tests for utility functions in the package
  • Tests focus on type stability verification using @test_opt

Details

This PR adds JET.jl static analysis tests to the test suite. Due to the heavy metaprogramming with @component and @connector macros, 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 function
  • transition - smooth transition between values
  • friction_factor - pipe flow friction factor calculation

Blocks source functions:

  • smooth_step - smooth step function
  • smooth_xH - smooth ramp helper
  • square - square wave generator
  • triangular - triangular wave generator

Electrical digital logic:

  • _and2, _or2, _not, _xor2 - logic operations

All 19 tests pass locally.

Test Plan

  • Run test/jet.jl locally - passes (19/19 tests)
  • Run Aqua tests - still passes (10/10 tests)
  • CI should pass

cc @ChrisRackauckas


Generated with Claude Code

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>
# 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

# which generate code at macro expansion time. Full package analysis with JET times out.

times out for whom? 😅

@ChrisRackauckas
Copy link
Member

This is being deprecated anyways

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