From f8ad94bcae36fe39d826ed8e89aeafe1faa02d91 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Thu, 25 Jun 2026 05:50:55 -0400 Subject: [PATCH 1/3] QA: run_qa v1.6 form + ExplicitImports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convert test/qa/qa.jl from the hand-rolled Aqua.test_all + JET.test_package body to the SciMLTesting 1.6 run_qa form, with ExplicitImports enabled. run_qa now drives all three QA tools: - Aqua (SciMLTesting dep): full test_all, no sub-checks disabled. - JET (weakdep, opt-in via `using JET`): runs clean (0 reports). - ExplicitImports (SciMLTesting dep): all 6 checks via explicit_imports = true. Resolve every finding to a hard pass (0 FAIL / ERROR / BROKEN), so no @test_broken placeholders remain: Aqua (previously @test_broken, tracked in #306) — FIXED, markers removed: - stale_deps: Calculus was declared in [deps] but used nowhere; removed it from [deps] and [compat]. - deps_compat (deps): LinearAlgebra had no [compat] entry; added LinearAlgebra = "1.10". (The #306 "Pkg in [extras]" finding was already stale — no Pkg in extras.) ExplicitImports: - all_qualified_accesses_via_owners: FIXED. AbstractNoTimeSolution, AbstractEnsembleSolution, and build_solution were accessed via DiffEqBase but are owned by SciMLBase; switched the qualified module to the owner (SciMLBase.X). - all_qualified_accesses_are_public / all_explicit_imports_are_public: ignore other packages' not-yet-public names (SciMLBase, DiffEqBase, CommonSolve, StatsAPI), documented per-name with their source. Several (successful_retcode, ReturnCode.Success, loglikelihood) are only flagged on Julia 1.10's public DB, so they are ignored to keep both the lts and "1" QA lanes green. - no_implicit_imports / no_stale_explicit_imports / all_explicit_imports_via_owners: already passing. Also remove the redundant standalone test/explicit_imports.jl (a top-level Core file whose checks are now covered by the QA group's run_qa) and drop ExplicitImports from the root [extras]/[targets].test (transitive via SciMLTesting in the QA sub-env). Deps: test/qa/Project.toml SciMLTesting compat -> "1.6"; Aqua and JET kept direct (Aqua's ambiguities child-process needs Aqua a direct dep; JET runs). Verified locally against the released SciMLTesting 1.6.0: QA group 18/18 pass, 0 fail / error / broken on both Julia 1.10 (lts) and 1.11 ("1"). Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- Project.toml | 7 ++--- src/cost_functions.jl | 12 ++++----- src/multiple_shooting_objective.jl | 2 +- test/explicit_imports.jl | 8 ------ test/qa/Project.toml | 2 +- test/qa/qa.jl | 42 +++++++++++++++++++++--------- 6 files changed, 40 insertions(+), 33 deletions(-) delete mode 100644 test/explicit_imports.jl diff --git a/Project.toml b/Project.toml index f69d8c2..9ba8f49 100644 --- a/Project.toml +++ b/Project.toml @@ -4,7 +4,6 @@ version = "2.4.0" authors = ["Chris Rackauckas "] [deps] -Calculus = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9" CommonSolve = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" Dierckx = "39dd38d3-220a-591b-8e3c-4c3a8c710a94" DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" @@ -19,14 +18,13 @@ StatsAPI = "82ae8749-77ed-4fe6-ae5f-f523153014b0" [compat] BlackBoxOptim = "0.6" -Calculus = "0.5.2" CommonSolve = "0.2.6" DelayDiffEq = "5.63, 6" Dierckx = "0.5" DiffEqBase = "6.213, 7" Distributions = "0.25.87" -ExplicitImports = "1" ForwardDiff = "0.10.38" +LinearAlgebra = "1.10" Logging = "1" NLopt = "0.6, 1" Optim = "1" @@ -55,7 +53,6 @@ julia = "1.10" [extras] BlackBoxOptim = "a134a8b2-14d6-55f6-9291-3336d3ab0209" DelayDiffEq = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb" -ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" NLopt = "76087f3c-5699-56af-9a33-bf431cd00edd" @@ -76,4 +73,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" [targets] -test = ["Test", "ExplicitImports", "BlackBoxOptim", "DelayDiffEq", "ForwardDiff", "Logging", "NLopt", "Optim", "Optimization", "OptimizationBBO", "OptimizationNLopt", "OptimizationOptimJL", "OrdinaryDiffEq", "Random", "SafeTestsets", "SciMLSensitivity", "SciMLTesting", "StochasticDiffEq", "SteadyStateDiffEq", "Sundials", "Zygote"] +test = ["Test", "BlackBoxOptim", "DelayDiffEq", "ForwardDiff", "Logging", "NLopt", "Optim", "Optimization", "OptimizationBBO", "OptimizationNLopt", "OptimizationOptimJL", "OrdinaryDiffEq", "Random", "SafeTestsets", "SciMLSensitivity", "SciMLTesting", "StochasticDiffEq", "SteadyStateDiffEq", "Sundials", "Zygote"] diff --git a/src/cost_functions.jl b/src/cost_functions.jl index e4dc359..3e076fe 100644 --- a/src/cost_functions.jl +++ b/src/cost_functions.jl @@ -33,14 +33,14 @@ struct L2Loss{T, D, U, W, G, B} <: DiffEqBase.DECostFunction du_buf::B end -function (f::L2Loss)(sol::DiffEqBase.AbstractNoTimeSolution) +function (f::L2Loss)(sol::SciMLBase.AbstractNoTimeSolution) data = f.data weight = f.data_weight diff_weight = f.differ_weight colloc_grad = f.colloc_grad dudt = f.dudt - if sol isa DiffEqBase.AbstractEnsembleSolution + if sol isa SciMLBase.AbstractEnsembleSolution failure = any(!SciMLBase.successful_retcode(s.retcode) for s in sol.u) else failure = !SciMLBase.successful_retcode(sol.retcode) @@ -73,7 +73,7 @@ function (f::L2Loss)(sol::SciMLBase.AbstractSciMLSolution) colloc_grad = f.colloc_grad dudt = f.dudt - if sol isa DiffEqBase.AbstractEnsembleSolution + if sol isa SciMLBase.AbstractEnsembleSolution failure = any(!SciMLBase.successful_retcode(s.retcode) for s in sol.u) else failure = !SciMLBase.successful_retcode(sol.retcode) @@ -172,7 +172,7 @@ function L2Loss( ) end -function (f::L2Loss)(sol::DiffEqBase.AbstractEnsembleSolution) +function (f::L2Loss)(sol::SciMLBase.AbstractEnsembleSolution) return mean(f.(sol.u)) end @@ -200,7 +200,7 @@ end function (f::LogLikeLoss)(sol::SciMLBase.AbstractSciMLSolution) distributions = f.data_distributions - if sol isa DiffEqBase.AbstractEnsembleSolution + if sol isa SciMLBase.AbstractEnsembleSolution failure = any(!SciMLBase.successful_retcode(s.retcode) for s in sol.u) else failure = !SciMLBase.successful_retcode(sol.retcode) @@ -248,7 +248,7 @@ function (f::LogLikeLoss)(sol::SciMLBase.AbstractSciMLSolution) return ll end -function (f::LogLikeLoss)(sol::DiffEqBase.AbstractEnsembleSolution) +function (f::LogLikeLoss)(sol::SciMLBase.AbstractEnsembleSolution) distributions = f.data_distributions failure = any(!SciMLBase.successful_retcode(s.retcode) for s in sol.u) failure && return Inf diff --git a/src/multiple_shooting_objective.jl b/src/multiple_shooting_objective.jl index 15f29d7..a76c25c 100644 --- a/src/multiple_shooting_objective.jl +++ b/src/multiple_shooting_objective.jl @@ -57,7 +57,7 @@ function multiple_shooting_objective( u = [uc for k in 1:K for uc in (k == K ? sol[k].u : sol[k].u[1:(end - 1)])] t = [tc for k in 1:K for tc in (k == K ? sol[k].t : sol[k].t[1:(end - 1)])] sol_loss = Merged_Solution(u, t, sol) - sol_new = DiffEqBase.build_solution( + sol_new = SciMLBase.build_solution( prob, alg, sol_loss.t, sol_loss.u, retcode = ReturnCode.Success ) diff --git a/test/explicit_imports.jl b/test/explicit_imports.jl deleted file mode 100644 index 0d76210..0000000 --- a/test/explicit_imports.jl +++ /dev/null @@ -1,8 +0,0 @@ -using ExplicitImports -using DiffEqParamEstim -using Test - -@testset "ExplicitImports" begin - @test check_no_implicit_imports(DiffEqParamEstim) === nothing - @test check_no_stale_explicit_imports(DiffEqParamEstim) === nothing -end diff --git a/test/qa/Project.toml b/test/qa/Project.toml index a428c5a..0b12833 100644 --- a/test/qa/Project.toml +++ b/test/qa/Project.toml @@ -13,6 +13,6 @@ DiffEqParamEstim = {path = "../.."} Aqua = "0.8" JET = "0.9,0.10,0.11" SafeTestsets = "0.1, 1" -SciMLTesting = "1" +SciMLTesting = "1.6" Test = "1" julia = "1.10" diff --git a/test/qa/qa.jl b/test/qa/qa.jl index beb946c..168890e 100644 --- a/test/qa/qa.jl +++ b/test/qa/qa.jl @@ -1,13 +1,31 @@ -using DiffEqParamEstim, Aqua, JET, Test +using SciMLTesting, DiffEqParamEstim, JET, Test -@testset "Aqua" begin - # stale_deps and deps_compat disabled: genuine findings tracked in - # https://github.com/SciML/DiffEqParamEstim.jl/issues/306 - Aqua.test_all(DiffEqParamEstim; stale_deps = false, deps_compat = false) - @test_broken false # Aqua stale_deps: Calculus is a stale dep — tracked in https://github.com/SciML/DiffEqParamEstim.jl/issues/306 - @test_broken false # Aqua deps_compat: LinearAlgebra dep + Pkg extra missing compat entries — tracked in https://github.com/SciML/DiffEqParamEstim.jl/issues/306 -end - -@testset "JET" begin - JET.test_package(DiffEqParamEstim; target_defined_modules = true) -end +run_qa( + DiffEqParamEstim; + explicit_imports = true, + ei_kwargs = ( + # SciMLBase/DiffEqBase solution+problem supertypes and helpers that + # DiffEqParamEstim dispatches on / subtypes; not (yet) declared public in + # their owner module. They go public as those base libraries release. + all_qualified_accesses_are_public = (; + ignore = ( + :AbstractDEProblem, # SciMLBase + :AbstractEnsembleSolution, # SciMLBase + :AbstractNoTimeSolution, # SciMLBase + :AbstractSciMLProblem, # SciMLBase + :AbstractSciMLSolution, # SciMLBase + :NoAD, # SciMLBase + :build_solution, # SciMLBase + :successful_retcode, # SciMLBase (flagged on Julia 1.10 only) + :Success, # SciMLBase.ReturnCode (flagged on Julia 1.10 only) + :DECostFunction, # DiffEqBase + ), + ), + all_explicit_imports_are_public = (; + ignore = ( + :solve, # CommonSolve canonical entry point, not declared public there + :loglikelihood, # StatsAPI (flagged on Julia 1.10 only) + ), + ), + ), +) From e5771682c9d6cac4d062bbf7471c3decaa04a915 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Fri, 26 Jun 2026 15:08:58 -0400 Subject: [PATCH 2/3] QA: prune redundant public-API EI ignores after base-lib make-public releases SciMLTesting 1.7 runs the public-API ExplicitImports checks (all_qualified_accesses_are_public, all_explicit_imports_are_public) only on Julia >= 1.11. With SciMLBase 3.24.0 / CommonSolve 0.2.9 / StatsAPI now declaring these names public, most prior ignores are redundant. Removed (now public in their owner module, verified on Julia 1.12 against registered releases): qualified accesses: AbstractSciMLProblem, AbstractSciMLSolution, build_solution, successful_retcode, Success (all SciMLBase) explicit imports: solve (CommonSolve), loglikelihood (StatsAPI) Retained (still non-public, genuine base-lib internals): AbstractDEProblem, AbstractEnsembleSolution, AbstractNoTimeSolution, NoAD (SciMLBase); DECostFunction (DiffEqBase) Verified: QA group green on Julia 1.12 (18/18, public checks run) and Julia 1.10 (16/16, public checks skipped) against registered releases. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- test/qa/qa.jl | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/test/qa/qa.jl b/test/qa/qa.jl index 168890e..65bcee4 100644 --- a/test/qa/qa.jl +++ b/test/qa/qa.jl @@ -4,28 +4,16 @@ run_qa( DiffEqParamEstim; explicit_imports = true, ei_kwargs = ( - # SciMLBase/DiffEqBase solution+problem supertypes and helpers that - # DiffEqParamEstim dispatches on / subtypes; not (yet) declared public in - # their owner module. They go public as those base libraries release. + # SciMLBase/DiffEqBase solution+problem supertypes that DiffEqParamEstim + # dispatches on / subtypes; not (yet) declared public in their owner module. all_qualified_accesses_are_public = (; ignore = ( :AbstractDEProblem, # SciMLBase :AbstractEnsembleSolution, # SciMLBase :AbstractNoTimeSolution, # SciMLBase - :AbstractSciMLProblem, # SciMLBase - :AbstractSciMLSolution, # SciMLBase :NoAD, # SciMLBase - :build_solution, # SciMLBase - :successful_retcode, # SciMLBase (flagged on Julia 1.10 only) - :Success, # SciMLBase.ReturnCode (flagged on Julia 1.10 only) :DECostFunction, # DiffEqBase ), ), - all_explicit_imports_are_public = (; - ignore = ( - :solve, # CommonSolve canonical entry point, not declared public there - :loglikelihood, # StatsAPI (flagged on Julia 1.10 only) - ), - ), ), ) From d36b18d44988432934f37cb453fdd4a60d0ef29c Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Fri, 26 Jun 2026 23:47:03 -0400 Subject: [PATCH 3/3] QA: strip now-public EI ignores after SciMLBase 3.27 / DiffEqBase 7.6 SciMLBase 3.27.0 declares the abstract problem/solution supertypes public, and DiffEqBase 7.6.0 declares DECostFunction public, so their public-API ExplicitImports ignores are now redundant. Remove: AbstractDEProblem, AbstractEnsembleSolution, AbstractNoTimeSolution (SciMLBase) DECostFunction (DiffEqBase) Retained: NoAD, which is owned by SciMLBase but is still not declared public there (verified Base.ispublic(SciMLBase, :NoAD) == false on 3.27.0). The source already accesses it via its owner (SciMLBase.NoAD), so it stays as a genuine non-public allowed ignore. Bump the QA env SciMLTesting floor to 1.7 so the public-API checks are gated to Julia >= 1.11 (run on 1.12, skipped on 1.10). Verified against registered releases (SciMLBase 3.27.0, DiffEqBase 7.6.0, SciMLTesting 1.7.0): Julia 1.12: QA group 18/18 (public-API checks run, only NoAD ignored) Julia 1.10: QA group 16/16 (public-API checks skipped) Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- test/qa/Project.toml | 2 +- test/qa/qa.jl | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/test/qa/Project.toml b/test/qa/Project.toml index 0b12833..6e696e5 100644 --- a/test/qa/Project.toml +++ b/test/qa/Project.toml @@ -13,6 +13,6 @@ DiffEqParamEstim = {path = "../.."} Aqua = "0.8" JET = "0.9,0.10,0.11" SafeTestsets = "0.1, 1" -SciMLTesting = "1.6" +SciMLTesting = "1.7" Test = "1" julia = "1.10" diff --git a/test/qa/qa.jl b/test/qa/qa.jl index 65bcee4..8518d8d 100644 --- a/test/qa/qa.jl +++ b/test/qa/qa.jl @@ -4,15 +4,10 @@ run_qa( DiffEqParamEstim; explicit_imports = true, ei_kwargs = ( - # SciMLBase/DiffEqBase solution+problem supertypes that DiffEqParamEstim - # dispatches on / subtypes; not (yet) declared public in their owner module. + # NoAD is owned by SciMLBase but not (yet) declared public there. all_qualified_accesses_are_public = (; ignore = ( - :AbstractDEProblem, # SciMLBase - :AbstractEnsembleSolution, # SciMLBase - :AbstractNoTimeSolution, # SciMLBase - :NoAD, # SciMLBase - :DECostFunction, # DiffEqBase + :NoAD, # SciMLBase ), ), ),