diff --git a/src/PDEBase.jl b/src/PDEBase.jl index 551032b..5fbd600 100644 --- a/src/PDEBase.jl +++ b/src/PDEBase.jl @@ -5,14 +5,14 @@ using SciMLBase: AbstractDiscretization, AbstractDiscretizationMetadata using ModelingToolkit using ModelingToolkit: get_unknowns, ProblemTypeCtx, get_ps, get_bcs, get_dvs, - parameters, varmap_to_vars, get_eqs, get_iv, + get_eqs, get_iv, get_domain, get_ivs, get_systems, get_connector_type, get_metadata, get_gui_metadata using Symbolics, SymbolicUtils -using Symbolics: unwrap, solve_for, expand_derivatives, diff2term, setname, rename, variable -using SymbolicUtils: operation, arguments, Chain, Prewalk, Postwalk, maketerm, metadata, - symtype, operation, iscall, arguments, getmetadata, unwrap_const, substitute +using Symbolics: unwrap, setname, rename +using SymbolicUtils: operation, arguments, Chain, Prewalk, maketerm, metadata, + iscall, getmetadata, unwrap_const, substitute using SymbolicIndexingInterface: is_time_dependent using DomainSets @@ -47,7 +47,7 @@ export AbstractBoundary, AbstractTruncatingBoundary, AbstractInterfaceBoundary, export get_time export count_differentials, differential_order, has_derivatives, find_derivative, d_orders, - subs_alleqs!, get_depvars, getvars, pde_substitute, pde_substitute_filter, + subs_alleqs!, get_depvars, getvars, pde_substitute, get_all_depvars, split_terms, split_additive_terms, subsmatch, ex2term, safe_unwrap, recursive_unwrap, flatten_vardict, filter_interfaces, isperiodic, isinterface, haslowerupper, has_interfaces, isupper diff --git a/src/parse_boundaries.jl b/src/parse_boundaries.jl index 2d3c3ec..8ce22e1 100644 --- a/src/parse_boundaries.jl +++ b/src/parse_boundaries.jl @@ -187,7 +187,7 @@ function isperiodic( ) where {b1u, b1u2, b2u, b2u2} us_equal = isequal(operation(b1.u), operation(b2.u2)) && isequal(operation(b2.u), operation(b1.u2)) - xs_equal = issequal(b1.x, b2.x2) && isequal(b1.x2, b2.x) + xs_equal = isequal(b1.x, b2.x2) && isequal(b1.x2, b2.x) return us_equal && xs_equal end @@ -311,7 +311,7 @@ function parse_bcs(bcs, v::VariableMap, orders) terms = split_terms(bc) # * Assume that the BC is defined on the edge of the domain # Check whether the bc is on the lower boundary, or periodic, we don't care which depvar/var - local u_, u__, x_, x__ + u_ = u__ = x_ = x__ = nothing isinterface = false interface_orders = [] for term in terms, r in flatten_vardict(lower_boundary_rules) diff --git a/test/qa/Project.toml b/test/qa/Project.toml index f5d58dd..c41c251 100644 --- a/test/qa/Project.toml +++ b/test/qa/Project.toml @@ -1,19 +1,17 @@ [deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" PDEBase = "a7812802-0625-4b9e-961c-d332478797e5" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283" -SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b" -Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [sources] PDEBase = {path = "../.."} [compat] +Aqua = "0.8" JET = "0.9, 0.10, 0.11" SafeTestsets = "0.0.1, 0.1, 1" -SciMLTesting = "1" -SymbolicUtils = "4" -Symbolics = "7" +SciMLTesting = "1.6" Test = "1" diff --git a/test/qa/jet_tests.jl b/test/qa/jet_tests.jl deleted file mode 100644 index 5bd2815..0000000 --- a/test/qa/jet_tests.jl +++ /dev/null @@ -1,60 +0,0 @@ -using JET -using PDEBase -using Test -import Symbolics -using SymbolicUtils: operation - -@testset "JET static analysis" begin - # Test core symbolic utility functions for type stability - # JET reports from dependencies (Symbolics, SymbolicUtils) are filtered - # via target_modules to avoid noise from transitive symbolic-stack issues. - @eval Symbolics.@variables x y t - @eval Symbolics.@variables u(..) - - x_sym = Symbolics.unwrap(x) - u_term = Symbolics.unwrap(u(x, y, t)) - depvar_ops = [operation(u_term)] - - Dx = Symbolics.Differential(x) - term = Symbolics.unwrap(Dx(u(x, y, t))) - - @testset "safe_unwrap" begin - rep = JET.report_call( - PDEBase.safe_unwrap, (typeof(u(x, y, t)),); - target_modules = (PDEBase,) - ) - @test length(JET.get_reports(rep)) == 0 - end - - @testset "has_derivatives" begin - rep = JET.report_call( - PDEBase.has_derivatives, (typeof(term),); - target_modules = (PDEBase,) - ) - @test length(JET.get_reports(rep)) == 0 - end - - @testset "count_differentials" begin - rep = JET.report_call( - PDEBase.count_differentials, (typeof(term), typeof(x_sym)); - target_modules = (PDEBase,) - ) - @test length(JET.get_reports(rep)) == 0 - end - - @testset "find_derivative" begin - rep = JET.report_call( - PDEBase.find_derivative, (typeof(term), typeof(operation(u_term))); - target_modules = (PDEBase,) - ) - @test length(JET.get_reports(rep)) == 0 - end - - @testset "recursive_unwrap" begin - rep = JET.report_call( - PDEBase.recursive_unwrap, (typeof(term),); - target_modules = (PDEBase,) - ) - @test length(JET.get_reports(rep)) == 0 - end -end diff --git a/test/qa/qa.jl b/test/qa/qa.jl new file mode 100644 index 0000000..9e81973 --- /dev/null +++ b/test/qa/qa.jl @@ -0,0 +1,50 @@ +using SciMLTesting, PDEBase, Test +using JET + +run_qa( + PDEBase; + explicit_imports = true, + # symbolic_discretize(::PDESystem, ::AbstractDiscretization) extends + # SciMLBase.symbolic_discretize as PDEBase's discretization entry point; the + # function is conceptually owned by the discretization stack PDEBase implements. + aqua_kwargs = (; + piracies = (; treat_as_own = [PDEBase.symbolic_discretize]), + deps_compat = (; check_extras = false), + ), + ei_kwargs = (; + all_explicit_imports_via_owners = (; + ignore = ( + # re-exported by ModelingToolkit; owner ModelingToolkitBase + :ProblemTypeCtx, :get_bcs, :get_connector_type, :get_domain, + :get_dvs, :get_eqs, :get_gui_metadata, :get_iv, :get_ivs, + :get_metadata, :get_ps, :get_systems, :get_unknowns, + # re-exported by SymbolicUtils; owner TermInterface + :maketerm, :metadata, + # re-exported by Symbolics; owner SymbolicUtils + :unwrap, + ), + ), + all_qualified_accesses_via_owners = (; + ignore = ( + :ExtraVariablesSystemException, # ModelingToolkit re-export; owner ModelingToolkitBase + ), + ), + all_qualified_accesses_are_public = (; + ignore = ( + :ExtraVariablesSystemException, # ModelingToolkit non-public + ), + ), + all_explicit_imports_are_public = (; + ignore = ( + :AbstractDiscretization, :AbstractDiscretizationMetadata, # SciMLBase non-public + :Chain, :Prewalk, :maketerm, :metadata, # SymbolicUtils non-public + :ProblemTypeCtx, # ModelingToolkit non-public + :rename, :setname, # Symbolics non-public + ), + ), + ), + # PDEBase's public surface rests on heavy `using ModelingToolkit / Symbolics / + # SymbolicUtils / SciMLBase / DomainSets`; making each implicitly used name + # explicit is a large, risky refactor tracked separately. See the QA PR. + ei_broken = (:no_implicit_imports,), +)