Import public API from its owning module, not a re-exporter - #4880
Merged
ChrisRackauckas merged 1 commit intoAug 7, 2026
Merged
Conversation
`ExplicitImports.check_all_explicit_imports_via_owners` and
`check_all_qualified_accesses_via_owners` both failed on `ModelingToolkit`
because ten bindings were reached through a package that merely forwards them:
- `@add_kwonly`, `NullParameters`, `value` via `DiffEqBase` (owner `SciMLBase`)
- `Operator`, `Term`, `_iszero`, `_isone` via `Symbolics` (owner `SymbolicUtils`)
- `getname` via `Symbolics` (owner `SymbolicIndexingInterface`)
- `maketerm`, `metadata` via `SymbolicUtils` (owner `TermInterface`)
- `topological_sort`, `value`, `var_from_nested_derivative`, `schedule` via
`ModelingToolkitBase` in the `StructuralTransformations` submodule
(owners `Graphs`, `Symbolics`, `Symbolics`, `Base`)
Each name is now imported from the module that declares it. Every relocated
binding was checked to be `===` to the one previously used, so this is a pure
import-site change with no behaviour difference. `schedule` was unused and is
dropped rather than re-pointed.
Four of the moved names (`@add_kwonly`, `NullParameters`, `value`, `getname`)
plus `maketerm`/`metadata` are `public` at their owner but not at the
re-exporter, so this also drops the `*_are_public` findings from 57/91 to
53/89.
`TermInterface` becomes a direct dependency; it was already in the manifest
through `SymbolicUtils`.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
This was referenced Aug 5, 2026
ChrisRackauckas
marked this pull request as ready for review
August 7, 2026 02:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please ignore until reviewed by @ChrisRackauckas.
Problem
On unmodified
master(32a955a), the QA lane's ExplicitImports checks fail. Two of them are about provenance:ModelingToolkitreaches ten bindings through a package that merely forwards them, rather than through the module that declares them.Fixing those exposed four more in the
ModelingToolkit.StructuralTransformationssubmodule (ExplicitImports reports the first failing module only):topological_sort(ownerGraphs),valueandvar_from_nested_derivative(ownerSymbolics), andschedule(ownerBase), all imported fromModelingToolkitBase.Change
Each name is imported from its owner.
schedulehad no use site inStructuralTransformations(onlysys.scheduleandget_scheduleappear), so it is dropped rather than re-pointed.TermInterfacebecomes a direct dependency; it was already in the manifest viaSymbolicUtils.Verification
All 13 relocated bindings are
===to the ones previously used, so this is a pure import-site change:Both checks now pass (run against this branch on Julia 1.11):
Six of the moved names are
publicat their owner but not at the re-exporter, so the two remaining*_are_publicchecks also improve, from 57 to 53 explicit-import findings and from 91 to 89 qualified-access findings. Those two checks are not closed by this PR.Functional checks run locally against this branch:
test/semilinearodeproblem.jl(the file containing theDiffEqBase.value->SciMLBase.valuechange):Test Summary: Astrochem model | 61 Pass 6 Broken 67 Total 5m57.7smtkcompile+ODEProblem+solve(Rodas5P()), index-3 pendulummtkcompile(exercisesStructuralTransformations), andlinearization_function/linearizeall pass.🤖 Generated with Claude Code
https://claude.ai/code/session_019ywCW8vbGoc9X3dUbmXyme