diff --git a/lib/CanonicalMoments/src/CanonicalMoments.jl b/lib/CanonicalMoments/src/CanonicalMoments.jl index a178929..b137634 100644 --- a/lib/CanonicalMoments/src/CanonicalMoments.jl +++ b/lib/CanonicalMoments/src/CanonicalMoments.jl @@ -1,14 +1,16 @@ module CanonicalMoments -using Polynomials, LinearAlgebra, RecurrenceRelationships, Reexport +using Polynomials: Polynomials, AbstractPolynomial, Polynomial, coeffs +using LinearAlgebra: LinearAlgebra, SymTridiagonal +using RecurrenceRelationships: forwardrecurrence +using Reexport: @reexport @reexport using DiscreteMeasures -import Base: isapprox, inv, denominator, numerator +import Base: isapprox, denominator, numerator import Statistics: mean import LinearAlgebra: issymmetric import DiscreteMeasures: support, weights -import Polynomials: denominator, numerator function DEFAULT_ROOT_SOLVER(C, args...; kwargs...) return if length(C) == 3 # 2nd order diff --git a/lib/CanonicalMoments/test/qa/Project.toml b/lib/CanonicalMoments/test/qa/Project.toml index 50503eb..ea5c2eb 100644 --- a/lib/CanonicalMoments/test/qa/Project.toml +++ b/lib/CanonicalMoments/test/qa/Project.toml @@ -3,6 +3,7 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" CanonicalMoments = "58d2c334-1a3c-4862-bb37-9012b9e58a38" DiscreteMeasures = "7766d772-2108-41ee-a4bd-11c51440a39b" JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [sources] @@ -14,5 +15,6 @@ Aqua = "0.8" CanonicalMoments = "0.1" DiscreteMeasures = "0.1" JET = "0.9, 0.10, 0.11" +SciMLTesting = "1.7" Test = "1" julia = "1.10" diff --git a/lib/CanonicalMoments/test/qa/qa.jl b/lib/CanonicalMoments/test/qa/qa.jl index b4a326e..c24bb90 100644 --- a/lib/CanonicalMoments/test/qa/qa.jl +++ b/lib/CanonicalMoments/test/qa/qa.jl @@ -1,12 +1,12 @@ -using CanonicalMoments -using Aqua -using JET -using Test +using SciMLTesting, CanonicalMoments, JET, Test -@testset "Aqua" begin - Aqua.test_all(CanonicalMoments) -end - -@testset "JET" begin - JET.test_package(CanonicalMoments; target_defined_modules = true) -end +run_qa( + CanonicalMoments; + explicit_imports = true, + ei_kwargs = (; + # `@reexport using DiscreteMeasures` necessarily brings the `DiscreteMeasures` + # module name (and its `DiscreteMeasure` export, used here) implicitly; the + # re-export is intentional, so these are not implicit-imports to clean up. + no_implicit_imports = (; ignore = (:DiscreteMeasures, :DiscreteMeasure)), + ), +) diff --git a/lib/DiscreteMeasures/test/qa/Project.toml b/lib/DiscreteMeasures/test/qa/Project.toml index 4f3c930..9c9a138 100644 --- a/lib/DiscreteMeasures/test/qa/Project.toml +++ b/lib/DiscreteMeasures/test/qa/Project.toml @@ -2,6 +2,7 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" DiscreteMeasures = "7766d772-2108-41ee-a4bd-11c51440a39b" JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [sources] @@ -11,5 +12,6 @@ DiscreteMeasures = {path = "../.."} Aqua = "0.8" DiscreteMeasures = "0.1" JET = "0.9, 0.10, 0.11" +SciMLTesting = "1.7" Test = "1" julia = "1.10" diff --git a/lib/DiscreteMeasures/test/qa/qa.jl b/lib/DiscreteMeasures/test/qa/qa.jl index c76ecaa..a188dd6 100644 --- a/lib/DiscreteMeasures/test/qa/qa.jl +++ b/lib/DiscreteMeasures/test/qa/qa.jl @@ -1,12 +1,3 @@ -using DiscreteMeasures -using Aqua -using JET -using Test +using SciMLTesting, DiscreteMeasures, JET, Test -@testset "Aqua" begin - Aqua.test_all(DiscreteMeasures) -end - -@testset "JET" begin - JET.test_package(DiscreteMeasures; target_defined_modules = true) -end +run_qa(DiscreteMeasures; explicit_imports = true) diff --git a/lib/OUQBase/Project.toml b/lib/OUQBase/Project.toml index 3b3a53e..a3c6051 100644 --- a/lib/OUQBase/Project.toml +++ b/lib/OUQBase/Project.toml @@ -12,7 +12,6 @@ ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78" NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -PolynomialRoots = "3a141323-8675-5d76-9d11-e1df1406c778" Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" @@ -31,7 +30,6 @@ Optimization = "5" OptimizationBBO = "0.4" OrderedCollections = "1.7.0" Pkg = "1.10" -PolynomialRoots = "1" Polynomials = "4.0.13" Reexport = "1.2.2" SciMLBase = "2.153" diff --git a/lib/OUQBase/src/reduction_transformations/canonical_moments.jl b/lib/OUQBase/src/reduction_transformations/canonical_moments.jl index cd5d4b8..f4f7e4f 100644 --- a/lib/OUQBase/src/reduction_transformations/canonical_moments.jl +++ b/lib/OUQBase/src/reduction_transformations/canonical_moments.jl @@ -271,7 +271,7 @@ function construct_optimization_problem( (rand_var_vec) -> substitute(~f, Dict(constituent_random_variables .=> rand_var_vec)) # QN: Will variables always be passed in right order? Should be correct since this order is preserved in getting the induced_discrete_measure. - ouq_obj_f = simplify(obj_expression; rewriter = extract_f_rule) + ouq_obj_f = Symbolics.simplify(obj_expression; rewriter = extract_f_rule) else error("Objective is not a ProbabilityObjective or ExpectationObjective") end diff --git a/lib/OUQBase/src/reduction_transformations/winkler_extremal_measures.jl b/lib/OUQBase/src/reduction_transformations/winkler_extremal_measures.jl index ee9673a..8e499bf 100644 --- a/lib/OUQBase/src/reduction_transformations/winkler_extremal_measures.jl +++ b/lib/OUQBase/src/reduction_transformations/winkler_extremal_measures.jl @@ -370,8 +370,8 @@ function construct_optimization_problem( oracle_or_symbolic::Symbolic; kwargs..., ) - @debug "Objective: $objective.objective" objective = ouq_sys.objective + @debug "Objective: $(objective._obj)" extract_condition_rule = @rule ℙ(~condition) => ~condition condition = Symbolics.simplify(objective._obj; rewriter = extract_condition_rule) _discrete_measure_map = diff --git a/lib/OUQBase/test/qa/Project.toml b/lib/OUQBase/test/qa/Project.toml index 98aba77..31a3ed2 100644 --- a/lib/OUQBase/test/qa/Project.toml +++ b/lib/OUQBase/test/qa/Project.toml @@ -4,6 +4,7 @@ CanonicalMoments = "58d2c334-1a3c-4862-bb37-9012b9e58a38" DiscreteMeasures = "7766d772-2108-41ee-a4bd-11c51440a39b" JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" OUQBase = "01930cae-99d2-7439-8f4f-ace2ece9f1b9" +SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [sources] @@ -17,5 +18,6 @@ CanonicalMoments = "0.1" DiscreteMeasures = "0.1" JET = "0.9, 0.10, 0.11" OUQBase = "0.1" +SciMLTesting = "1.7" Test = "1" julia = "1.10" diff --git a/lib/OUQBase/test/qa/qa.jl b/lib/OUQBase/test/qa/qa.jl index 1bbf9ff..2b344d7 100644 --- a/lib/OUQBase/test/qa/qa.jl +++ b/lib/OUQBase/test/qa/qa.jl @@ -1,12 +1,41 @@ -using OUQBase -using Aqua -using JET -using Test +using SciMLTesting, OUQBase, JET, Test -@testset "Aqua" begin - Aqua.test_all(OUQBase) -end - -@testset "JET" begin - JET.test_package(OUQBase; target_defined_modules = true) -end +run_qa( + OUQBase; + explicit_imports = true, + # piracies: OUQBase defines `CanonicalMoments.RawMomentSequence(::Symbolics.Num, ...)`, + # owning neither the type nor the arg types; resolving it is a design change. + aqua_broken = (:piracies,), # SciML/OptimalUncertaintyQuantification.jl#33 + ei_kwargs = (; + # Names re-exported by Symbolics but owned by SymbolicUtils. + all_explicit_imports_via_owners = (; ignore = (:BasicSymbolic, :Term, :symtype)), + # Names that are non-public in the upstream majors OUQBase actually resolves. + # OUQBase's [compat] caps SciMLBase 2.x / Symbolics 6.x / SymbolicUtils 3.x / + # ModelingToolkit 9.x, where these are not `public`-declared; the public + # declarations only landed in the later majors that [compat] excludes + # (verified against the registered releases on Julia 1.12: each name below was + # re-flagged by an empty-ignore-list run, resolving SciMLBase 2.153.1 / + # Symbolics 6.58.0 / SymbolicUtils 3.32.0 / ModelingToolkit 9.84.0). + # :BasicSymbolic/:Operator/:Term/:symtype/:value - Symbolics + all_explicit_imports_are_public = (; + ignore = (:BasicSymbolic, :Operator, :Term, :symtype, :value), + ), + # Non-public qualified accesses into upstream packages (and own monorepo + # siblings); still non-public in the resolved upstream majors: + # :AbstractSupportAlg/:AbstractWeightAlg - CanonicalMoments (sibling) + # :BasicSymbolic/:isbinop/:promote_symtype - SymbolicUtils + # :evaluate/:geq/:leq - Symbolics + # :getdefault - ModelingToolkit + # :NoAD/:NullParameters - SciMLBase + all_qualified_accesses_are_public = (; + ignore = ( + :AbstractSupportAlg, :AbstractWeightAlg, :BasicSymbolic, :NoAD, + :NullParameters, :evaluate, :geq, :getdefault, :isbinop, :leq, + :promote_symtype, + ), + ), + ), + # OUQBase pulls heavy `using ModelingToolkit/Symbolics/Optimization/JuMP/...`; + # making those ~40 names explicit is a large refactor tracked separately. + ei_broken = (:no_implicit_imports,), # SciML/OptimalUncertaintyQuantification.jl#32 +) diff --git a/src/OptimalUncertaintyQuantification.jl b/src/OptimalUncertaintyQuantification.jl index 6468157..faf717f 100644 --- a/src/OptimalUncertaintyQuantification.jl +++ b/src/OptimalUncertaintyQuantification.jl @@ -1,6 +1,6 @@ module OptimalUncertaintyQuantification -using Reexport +using Reexport: @reexport @reexport using OUQBase end # module diff --git a/test/qa/Project.toml b/test/qa/Project.toml index d7d9df5..f8599fb 100644 --- a/test/qa/Project.toml +++ b/test/qa/Project.toml @@ -5,6 +5,7 @@ DiscreteMeasures = "7766d772-2108-41ee-a4bd-11c51440a39b" JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" OUQBase = "01930cae-99d2-7439-8f4f-ace2ece9f1b9" OptimalUncertaintyQuantification = "91ab1271-1799-4997-981e-07ad84422b0d" +SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [sources] @@ -20,5 +21,6 @@ DiscreteMeasures = "0.1" JET = "0.9, 0.10, 0.11" OUQBase = "0.1" OptimalUncertaintyQuantification = "0.1" +SciMLTesting = "1.7" Test = "1" julia = "1.10" diff --git a/test/qa/qa.jl b/test/qa/qa.jl index 701b77c..69c139f 100644 --- a/test/qa/qa.jl +++ b/test/qa/qa.jl @@ -1,12 +1,12 @@ -using OptimalUncertaintyQuantification -using Aqua -using JET -using Test +using SciMLTesting, OptimalUncertaintyQuantification, JET, Test -@testset "Aqua" begin - Aqua.test_all(OptimalUncertaintyQuantification) -end - -@testset "JET" begin - JET.test_package(OptimalUncertaintyQuantification; target_defined_modules = true) -end +run_qa( + OptimalUncertaintyQuantification; + explicit_imports = true, + ei_kwargs = (; + # `@reexport using OUQBase` necessarily brings the `OUQBase` module name into + # scope; that re-export is the umbrella package's whole purpose, so the module + # name is not a genuine implicit-import to clean up. + no_implicit_imports = (; ignore = (:OUQBase,)), + ), +)