Improve explicit imports hygiene#69
Merged
ChrisRackauckas merged 1 commit intoSciML:masterfrom Dec 29, 2025
Merged
Conversation
- Convert implicit imports to explicit imports in src/DASSL.jl:
- `using Reexport: @reexport` instead of `using Reexport`
- `using DiffEqBase: DiffEqBase` for explicit module reference
- `using LinearAlgebra: diagm, factorize, norm` instead of `using LinearAlgebra`
- `using PrecompileTools: @compile_workload, @setup_workload` instead of `using PrecompileTools`
- `using SciMLBase: DAEProblem, SciMLBase` for explicit imports
- Convert implicit imports to explicit imports in src/common.jl:
- Import `AbstractDAEAlgorithm`, `AbstractDAEProblem`, `build_solution`, `isinplace` from SciMLBase
- Use imported names directly instead of `DiffEqBase.` prefixes
- Add SciMLBase as explicit dependency in Project.toml
- Fix test/runtests.jl:
- Add explicit `using LinearAlgebra: diagm, I`
- Fix deprecated `eye()` usage to `Matrix{Float64}(I, n, n)`
- Fix `diagm(2y)` to `diagm(0 => 2y)` for proper syntax
- Add ExplicitImports.jl tests to CI:
- Add test/explicit_imports.jl with checks for implicit and stale imports
- Add ExplicitImports as test dependency
- Include explicit imports tests in runtests.jl
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.
Summary
eye()usage in testsChanges
src/DASSL.jl
using Reexport: @reexportinstead ofusing Reexportusing DiffEqBase: DiffEqBasefor explicit module referenceusing LinearAlgebra: diagm, factorize, norminstead ofusing LinearAlgebrausing PrecompileTools: @compile_workload, @setup_workloadinstead ofusing PrecompileToolsusing SciMLBase: DAEProblem, SciMLBasefor explicit importssrc/common.jl
AbstractDAEAlgorithm,AbstractDAEProblem,build_solution,isinplacefrom SciMLBaseDiffEqBase.prefixesProject.toml
test/runtests.jl
using LinearAlgebra: diagm, Ieye()usage toMatrix{Float64}(I, n, n)diagm(2y)todiagm(0 => 2y)for proper syntaxtest/explicit_imports.jl (new)
Test plan
Pkg.test()locally - all tests passcc @ChrisRackauckas
🤖 Generated with Claude Code