Skip to content

Improve explicit imports hygiene#69

Merged
ChrisRackauckas merged 1 commit intoSciML:masterfrom
ChrisRackauckas-Claude:explicit-imports-20251229-162903
Dec 29, 2025
Merged

Improve explicit imports hygiene#69
ChrisRackauckas merged 1 commit intoSciML:masterfrom
ChrisRackauckas-Claude:explicit-imports-20251229-162903

Conversation

@ChrisRackauckas-Claude
Copy link
Contributor

Summary

  • Add explicit imports to eliminate implicit imports detected by ExplicitImports.jl
  • Add SciMLBase as an explicit dependency
  • Fix deprecated eye() usage in tests
  • Add ExplicitImports.jl tests to CI to prevent regression

Changes

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

src/common.jl

  • Import AbstractDAEAlgorithm, AbstractDAEProblem, build_solution, isinplace from SciMLBase
  • Use imported names directly instead of DiffEqBase. prefixes

Project.toml

  • Add SciMLBase as explicit dependency
  • Add ExplicitImports as test dependency

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

test/explicit_imports.jl (new)

  • Add ExplicitImports.jl checks to prevent regression

Test plan

  • Run Pkg.test() locally - all tests pass
  • ExplicitImports checks pass

cc @ChrisRackauckas

🤖 Generated with Claude Code

- 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]>
@ChrisRackauckas ChrisRackauckas merged commit 9e5780f into SciML:master Dec 29, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants