Commit 776d7c7
QA: run_qa v1.6 form + ExplicitImports (#468)
* QA: run_qa v1.6 form + ExplicitImports
Convert the hand-rolled test/qa Aqua body to SciMLTesting's run_qa v1.6
declarative form and enable ExplicitImports (explicit_imports = true).
- Add a test/qa/Project.toml sub-env (Aqua + SciMLTesting "1.6" + SafeTestsets
+ Test, package via [sources]) so the QA group is isolated, matching the
SciMLTesting folder model used by sibling repos.
- qa.jl now calls run_qa(ModelingToolkitStandardLibrary; explicit_imports = true,
...). Aqua + ExplicitImports come from SciMLTesting's own deps. JET is not run
(the prior QA did not run JET). The original non-broken Aqua tweak
(ambiguities recursive = false) is preserved via aqua_kwargs.
- ExplicitImports findings (vs released SciMLTesting 1.6.0):
* no_stale_explicit_imports: FIXED by removing genuinely unused imports
(RealOutput in Electrical / IsothermalCompressible / TranslationalModelica;
getdefault + IfElse.ifelse in Translational).
* all_explicit_imports_via_owners / *_are_public / all_qualified_accesses_are_public:
ignore other packages' non-public names (unwrap<-Symbolics, ifelse<-IfElse,
getdefault/isvariable/t_nounits<-ModelingToolkitBase, SConst<-Symbolics,
depwarn<-Base). Documented per source.
* no_implicit_imports: many submodules `using ModelingToolkitBase, Symbolics,
IfElse` for exported names/macros; mass-explicit refactor is large and tracked
in #467, kept as ei_broken = (:no_implicit_imports,).
- Drop now-stale Aqua from the root [extras]/[targets].test/[compat] (Aqua moved
to the QA sub-env; ExplicitImports stays transitive via SciMLTesting).
Verified locally on Julia 1.10 with SciMLTesting 1.6.0 from the registry:
QA group = 16 Pass, 1 Broken, 0 Fail, 0 Error.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Downgrade: raise DiffEqBase floor to 6.190
The Downgrade CI lane precompile-failed with a `CommonSolve.init` method
ambiguity between DiffEqBase's `init(::Union{AbstractDEProblem,
NonlinearProblem}, args...)` and NonlinearSolveBase's
`init(::AbstractNonlinearProblem, ::AbstractNonlinearTerminationMode, du, u,
...)`, surfaced while precompiling NonlinearSolveFirstOrder / OrdinaryDiffEq*.
DiffEqBase 6.190.0 (commit "remove NonlinearSolve things") dropped
`NonlinearProblem` from that `init` signature, removing the ambiguity. The
old floor 6.189.1 still carried the colliding method, so downgrade resolved
into the ambiguous state. Bump the floor to 6.190.
Verified on Julia 1.10: with DiffEqBase 6.190.0 and the CI-downgrade-resolved
solver stack (NonlinearSolveFirstOrder 1.7.0, NonlinearSolveBase 1.14.0,
SciMLBase 2.125.0, OrdinaryDiffEq 6.102.1, OrdinaryDiffEqBDF/SDIRK/Default/
NonlinearSolve at floors), all 51 packages precompile cleanly (the 5 that
failed in CI now pass). 6.190.0 requires SciMLBase >= 2.115.0, satisfied by
the resolved 2.125.0.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* QA: eliminate ExplicitImports exceptions (no implicit imports)
Make every submodule's `using ModelingToolkitBase/Symbolics/IfElse` explicit so
the package no longer relies on implicit imports, then drop the corresponding
ei exceptions from the QA configuration.
Source changes (per-module explicit name lists derived from
ExplicitImports.print_explicit_imports on Julia 1.12):
- Each component submodule now imports exactly the macros/types it uses
(e.g. @component, @connector, @nAmed, @parameters, @unpack, @variables,
System, Equation, Flow, compose, connect, extend, ParentScope,
domain_connect, @register_symbolic, @register_derivative, Differential),
plus the bare module names that are accessed qualified.
- Blocks/sources.jl: `using DiffEqBase`/`using PreallocationTools` made explicit
(DiffCache, GeneralLazyBufferCache, get_tmp); DiffEqBase had no used names so
only its module name is imported.
- The thin wrapper modules (Magnetic, Mechanical, Hydraulic) only reference the
ModelingToolkitBase module name, so they import just that.
qa.jl exceptions removed (verified now unnecessary against released
SciMLTesting 1.7.0 / SciMLBase 3.30 / ModelingToolkitBase 1.48 / Symbolics 7.29):
- ei_broken = (:no_implicit_imports,) -> all 16 modules now pass the check.
- all_explicit_imports_via_owners ignore (:unwrap) -> passes with no ignore.
- all_explicit_imports_are_public: dropped :unwrap (public in Symbolics) and
:getdefault (public in ModelingToolkitBase); only :ifelse remains.
- all_qualified_accesses_are_public: dropped :t_nounits (public) and :depwarn
(no longer flagged); only :ifelse, :SConst, :isvariable remain.
Remaining ignores are irreducible (genuinely non-public upstream names):
ifelse (IfElse's sole export, not declared public), SConst (Symbolics-internal,
used in a @register_derivative), isvariable (ModelingToolkitBase-internal).
Verified on Julia 1.12.6: full QA group green via run_qa (17 Pass / 0 Broken,
was 16 Pass / 1 Broken), and a smoke test constructs one component from every
affected module successfully (Blocks.Sine/DeadZone, Electrical.Pin,
IsothermalCompressible.Cap, FluxTubes.Ground, etc.). Runic-formatted.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0539325 commit 776d7c7
18 files changed
Lines changed: 79 additions & 44 deletions
File tree
- src
- Blocks
- Electrical
- Hydraulic
- IsothermalCompressible
- Magnetic
- FluxTubes
- Mechanical
- MultiBody2D
- Rotational
- TranslationalModelica
- TranslationalPosition
- Translational
- Thermal
- test/qa
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | | - | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | | - | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
| |||
66 | 64 | | |
67 | 65 | | |
68 | 66 | | |
69 | | - | |
| 67 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | | - | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | | - | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | | - | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
0 commit comments