Skip to content

Commit

Permalink
add ExplicitImports.jl tests (#44)
Browse files Browse the repository at this point in the history
* add ExplicitImports.jl tests

* fix tests

* comment

* remove unused imports
  • Loading branch information
ranocha authored Aug 19, 2024
1 parent 9f662cc commit b91a7ba
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/PositiveIntegrators.jl
Original file line number Diff line number Diff line change
@@ -1,43 +1,36 @@
module PositiveIntegrators

# 1. Load dependencies
using LinearAlgebra: LinearAlgebra, Tridiagonal, I, diag, diagind, mul!
using LinearAlgebra: LinearAlgebra, Tridiagonal, I, diag, mul!
using SparseArrays: SparseArrays, AbstractSparseMatrix,
issparse, nonzeros, nzrange, rowvals, spdiagm
using StaticArrays: SVector, MVector, SMatrix, StaticArray, @SVector, @SMatrix
using StaticArrays: SVector, SMatrix, StaticArray, @SVector, @SMatrix

using FastBroadcast: @..
using MuladdMacro: @muladd
using SimpleUnPack: @unpack

using Reexport: @reexport

@reexport using SciMLBase: ODEFunction, ODEProblem, init, solve
@reexport using SciMLBase: ODEProblem, init, solve

using SciMLBase: AbstractODEFunction, NullParameters, FullSpecialize, NoSpecialize,
using SciMLBase: AbstractODEFunction, NullParameters, FullSpecialize,
isinplace

# TODO: Check imports and using statements below, reduce if possible
using OrdinaryDiffEq: OrdinaryDiffEq, OrdinaryDiffEqAlgorithm, ODESolution

using SymbolicIndexingInterface
using SymbolicIndexingInterface: SymbolicIndexingInterface

using LinearSolve: LinearSolve, LinearProblem, LUFactorization, solve!

using SciMLBase: DEFAULT_OBSERVED
import SciMLBase: interp_summary,
__has_mass_matrix, __has_analytic, __has_tgrad,
__has_jac, __has_jvp, __has_vjp, __has_jac_prototype,
__has_sparsity, __has_Wfact, __has_Wfact_t,
__has_paramjac, __has_syms, __has_indepsym, __has_paramsyms,
__has_observed, __has_colorvec, __has_sys
import SciMLBase: interp_summary

using OrdinaryDiffEq: @cache,
DEFAULT_PRECS,
OrdinaryDiffEqAdaptiveAlgorithm,
OrdinaryDiffEqConstantCache, OrdinaryDiffEqMutableCache,
False,
recursivefill!, _vec, wrapprecs, dolinsolve
_vec
import OrdinaryDiffEq: alg_order, isfsal,
calculate_residuals, calculate_residuals!,
alg_cache, get_tmp_cache,
Expand Down Expand Up @@ -68,6 +61,7 @@ include("mprk.jl")
# modified Patankar-Runge-Kutta based on the SSP formulation of RK methods (SSPMPRK)
include("sspmprk.jl")

# interpolation for dense output
include("interpolation.jl")

# predefined PDS problems
Expand Down
2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Expand All @@ -11,6 +12,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Aqua = "0.7, 0.8"
ExplicitImports = "1.0.1"
LinearSolve = "2.21"
OrdinaryDiffEq = "6.59"
Plots = "1.11.1"
Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ using PositiveIntegrators
using LinearSolve: RFLUFactorization, LUFactorization, KrylovJL_GMRES

using Aqua: Aqua
using ExplicitImports: check_no_implicit_imports, check_no_stale_explicit_imports

"""
experimental_orders_of_convergence(prob, alg, dts;
Expand Down Expand Up @@ -210,6 +211,11 @@ end
ambiguities = false,)
end

@testset "ExplicitImports.jl" begin
@test isnothing(check_no_implicit_imports(PositiveIntegrators))
@test isnothing(check_no_stale_explicit_imports(PositiveIntegrators))
end

@testset "ConservativePDSFunction" begin
prod_1! = (P, u, p, t) -> begin
fill!(P, zero(eltype(P)))
Expand Down

0 comments on commit b91a7ba

Please sign in to comment.