Skip to content

Commit a1a8f45

Browse files
Merge pull request #151 from ChrisRackauckas-Claude/fix-master-ci
Split JET tests into QA group; fix docs link + LaTeXStrings import
2 parents 4d47e00 + 926a267 commit a1a8f45

9 files changed

Lines changed: 75 additions & 51 deletions

File tree

.github/workflows/Tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
- "pre"
2929
group:
3030
- Core
31-
- nopre
31+
- QA
3232
exclude:
3333
- version: "pre"
34-
group: nopre
34+
group: QA
3535
uses: "SciML/.github/.github/workflows/tests.yml@v1"
3636
with:
3737
julia-version: "${{ matrix.version }}"

docs/src/tutorials/deim_FitzHugh-Nagumo.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ steps:
3737
3. Project the model onto the identified subspace using DEIM to approximate nonlinear terms.
3838

3939
For step 1, we first construct a
40-
[`ModelingToolkit.PDESystem`](https://mtk.sciml.ai/stable/systems/PDESystem/)
40+
[`ModelingToolkit.PDESystem`](https://docs.sciml.ai/ModelingToolkit/stable/API/PDESystem/)
4141
describing the original FitzHugh-Nagumo model.
4242

4343
```@example deim_FitzHugh_Nagumo
4444
using ModelingToolkit
45+
using LaTeXStrings
4546
@variables x t v(..) w(..)
4647
Dx = Differential(x)
4748
Dxx = Dx^2

test/deim.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ order = 2
3838
discretization = MOLFiniteDifference(dxs, t; approx_order = order)
3939
ode_sys, tspan = symbolic_discretize(pde_sys, discretization)
4040
simp_sys = mtkcompile(ode_sys) # field substitutions is non-empty
41-
ode_prob = ODEProblem(simp_sys, nothing, tspan;
42-
missing_guess_value = ModelingToolkit.MissingGuessValue.Constant(0.0))
41+
ode_prob = ODEProblem(
42+
simp_sys, nothing, tspan;
43+
missing_guess_value = ModelingToolkit.MissingGuessValue.Constant(0.0)
44+
)
4345
sol = solve(ode_prob, Tsit5(), saveat = 1.0)
4446

4547
snapshot_simpsys = Array(sol.original_sol)

test/nopre/jet_tests.jl

Lines changed: 0 additions & 41 deletions
This file was deleted.

test/qa/jet_tests.jl

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
using Test, JET
2+
using ModelOrderReduction
3+
using LinearAlgebra: qr
4+
5+
@testset "JET Static Analysis" begin
6+
# Create test data
7+
n = 20 # state dimension
8+
m = 10 # number of snapshots
9+
snapshot_matrix = Float64[sin(i * j / n) for i in 1:n, j in 1:m]
10+
snapshot_vov = [Float64[sin(i * j / n) for i in 1:n] for j in 1:m]
11+
12+
# Create an orthonormal basis for deim_interpolation_indices
13+
Q, _ = qr(snapshot_matrix)
14+
deim_basis = Matrix(Q[:, 1:5])
15+
16+
# Restrict JET reports to issues originating in ModelOrderReduction itself.
17+
# Without this, transitive symbolic-stack type piracy (e.g. SymbolicUtils
18+
# overloading `ifelse`/`max` on `Integer`) bleeds into reports for purely
19+
# numeric code that never touches symbolic types at runtime.
20+
target = (ModelOrderReduction,)
21+
22+
@testset "deim_interpolation_indices type stability" begin
23+
rep = JET.report_call(
24+
ModelOrderReduction.deim_interpolation_indices,
25+
(Matrix{Float64},); target_modules = target
26+
)
27+
@test length(JET.get_reports(rep)) == 0
28+
end
29+
30+
@testset "matricize type stability" begin
31+
rep = JET.report_call(
32+
ModelOrderReduction.matricize,
33+
(Vector{Vector{Float64}},); target_modules = target
34+
)
35+
@test length(JET.get_reports(rep)) == 0
36+
end
37+
38+
@testset "POD constructor type stability" begin
39+
# Matrix constructor
40+
rep1 = JET.report_call(
41+
ModelOrderReduction.POD,
42+
(Matrix{Float64}, Int); target_modules = target
43+
)
44+
@test length(JET.get_reports(rep1)) == 0
45+
46+
# Vector{Vector} constructor
47+
rep2 = JET.report_call(
48+
ModelOrderReduction.POD,
49+
(Vector{Vector{Float64}}, Int); target_modules = target
50+
)
51+
@test length(JET.get_reports(rep2)) == 0
52+
end
53+
54+
@testset "reduce! with SVD type stability" begin
55+
pod = POD(snapshot_matrix, 3)
56+
rep = JET.report_call(
57+
ModelOrderReduction.reduce!,
58+
(typeof(pod), typeof(SVD())); target_modules = target
59+
)
60+
@test length(JET.get_reports(rep)) == 0
61+
end
62+
end

test/runtests.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ if GROUP == "All" || GROUP == "Core"
1414
end
1515
end
1616

17-
if GROUP == "nopre"
17+
if GROUP == "All" || GROUP == "QA"
1818
using Pkg
19-
Pkg.activate(@__DIR__() * "/nopre")
19+
Pkg.activate(@__DIR__() * "/qa")
2020
Pkg.develop(path = dirname(@__DIR__))
2121
Pkg.instantiate()
2222

2323
@safetestset "Quality Assurance" begin
24-
include("nopre/qa_tests.jl")
24+
include("qa/qa_tests.jl")
2525
end
2626
@safetestset "Explicit Imports" begin
27-
include("nopre/explicit_imports_tests.jl")
27+
include("qa/explicit_imports_tests.jl")
2828
end
2929
@safetestset "JET Static Analysis" begin
30-
include("nopre/jet_tests.jl")
30+
include("qa/jet_tests.jl")
3131
end
3232
end

0 commit comments

Comments
 (0)