Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/CanonicalMoments/src/CanonicalMoments.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/CanonicalMoments/test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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"
22 changes: 11 additions & 11 deletions lib/CanonicalMoments/test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -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)),
),
)
2 changes: 2 additions & 0 deletions lib/DiscreteMeasures/test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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"
13 changes: 2 additions & 11 deletions lib/DiscreteMeasures/test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 0 additions & 2 deletions lib/OUQBase/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 2 additions & 0 deletions lib/OUQBase/test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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"
51 changes: 40 additions & 11 deletions lib/OUQBase/test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -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
)
2 changes: 1 addition & 1 deletion src/OptimalUncertaintyQuantification.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module OptimalUncertaintyQuantification

using Reexport
using Reexport: @reexport
@reexport using OUQBase

end # module
2 changes: 2 additions & 0 deletions test/qa/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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"
22 changes: 11 additions & 11 deletions test/qa/qa.jl
Original file line number Diff line number Diff line change
@@ -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,)),
),
)
Loading