diff --git a/Project.toml b/Project.toml index cd9951d..2c51e95 100644 --- a/Project.toml +++ b/Project.toml @@ -21,6 +21,7 @@ ChainRulesCore = "1.26" ChainRulesTestUtils = "1" ForwardDiff = "1.1" InteractiveUtils = "1" +LinearAlgebra = "1" MacroTools = "0.5.16" OrdinaryDiffEq = "6, 7" PreallocationTools = "1.2" @@ -28,7 +29,7 @@ PrecompileTools = "1.2.1" RecursiveArrayTools = "3.54, 4" SafeTestsets = "0.1, 1" SciMLBase = "2, 3" -SciMLTesting = "1" +SciMLTesting = "1.5" StaticArrays = "1.9.18" Test = "1" julia = "1.10" diff --git a/src/LabelledArrays.jl b/src/LabelledArrays.jl index 577aae5..a51c8a9 100644 --- a/src/LabelledArrays.jl +++ b/src/LabelledArrays.jl @@ -1,6 +1,8 @@ module LabelledArrays -using LinearAlgebra, StaticArrays, ArrayInterface +using LinearAlgebra: LinearAlgebra +using StaticArrays: StaticArrays, MArray, SArray, Size, SOneTo, StaticArray, StaticVector +using ArrayInterface: ArrayInterface import RecursiveArrayTools, PreallocationTools, ForwardDiff include("slarray.jl") @@ -21,7 +23,7 @@ include("diffeqarray.jl") end end -using MacroTools +using MacroTools: MacroTools struct PrintWrapper{T, N, F, X <: AbstractArray{T, N}} <: AbstractArray{T, N} f::F @@ -84,7 +86,7 @@ function PreallocationTools.get_tmp( PreallocationTools.enlargediffcache!(dc, nelem) end _x = ArrayInterface.restructure(dc.du, reinterpret(T, view(dc.dual_du, 1:nelem))) - return LabelledArrays.LArray{T, N, D, Syms}(_x) + return LArray{T, N, D, Syms}(_x) end export SLArray, LArray, SLVector, LVector, @SLVector, @LArray, @LVector, @SLArray diff --git a/src/larray.jl b/src/larray.jl index cd806cd..5be8ed2 100644 --- a/src/larray.jl +++ b/src/larray.jl @@ -171,8 +171,8 @@ struct LAStyle{T, N, L} <: Broadcast.AbstractArrayStyle{N} end LAStyle{T, N, L}(x::Val{i}) where {T, N, L, i} = LAStyle{T, N, L}() Base.BroadcastStyle(::Type{LArray{T, N, D, L}}) where {T, N, D, L} = LAStyle{T, N, L}() function Base.BroadcastStyle( - ::LabelledArrays.LAStyle{T, N, L}, - ::LabelledArrays.LAStyle{E, N, L} + ::LAStyle{T, N, L}, + ::LAStyle{E, N, L} ) where {T, E, N, L} return LAStyle{promote_type(T, E), N, L}() end @@ -388,7 +388,7 @@ function SLArray( end function Base.vcat(x::LArray, y::LArray) - return LArray{(LabelledArrays.symnames(typeof(x))..., LabelledArrays.symnames(typeof(y))...)}( + return LArray{(symnames(typeof(x))..., symnames(typeof(y))...)}( vcat( x.__x, y.__x diff --git a/src/precompilation.jl b/src/precompilation.jl index 69b7008..86b7c33 100644 --- a/src/precompilation.jl +++ b/src/precompilation.jl @@ -1,4 +1,4 @@ -using PrecompileTools +using PrecompileTools: @setup_workload, @compile_workload @setup_workload begin @compile_workload begin diff --git a/src/slarray.jl b/src/slarray.jl index c423156..4da75d1 100644 --- a/src/slarray.jl +++ b/src/slarray.jl @@ -352,9 +352,6 @@ end function Base.reshape( x::SLArray{S, T, N, L, Syms}, ax::Tuple{SOneTo, Vararg{SOneTo}} - ) where { - S <: Tuple, T, N, L, Syms, - SOneTo <: SOneTo, - } + ) where {S <: Tuple, T, N, L, Syms} return SLArray{S, T, N, L, Syms}(reshape(x.__x, ax)) end diff --git a/test/qa/Project.toml b/test/qa/Project.toml index 34dc3e1..01a9f5a 100644 --- a/test/qa/Project.toml +++ b/test/qa/Project.toml @@ -1,15 +1,14 @@ [deps] -Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" -JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" LabelledArrays = "2ee39098-c373-598a-b85f-a56591580800" -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [sources] LabelledArrays = {path = "../.."} [compat] -Aqua = "0.8" -JET = "0.9,0.10,0.11" +SafeTestsets = "0.1, 1" +SciMLTesting = "1.5" Test = "1" julia = "1.10" diff --git a/test/qa/qa.jl b/test/qa/qa.jl index 5f13559..b1db123 100644 --- a/test/qa/qa.jl +++ b/test/qa/qa.jl @@ -1,26 +1,46 @@ -using LabelledArrays -using Aqua -using JET -using Test +using SciMLTesting, LabelledArrays, Test -@testset "Aqua" begin - # ambiguities / unbound_args / undefined_exports / deps_compat disabled: - # genuine Aqua findings tracked in https://github.com/SciML/LabelledArrays.jl/issues/205 - Aqua.test_all( - LabelledArrays; +# Aqua: ambiguities / unbound_args / undefined_exports are genuine pre-existing +# findings (method ambiguities, unbound type parameters, and the dead exports +# `@SLSliced`/`@LSliced`/`dimSymbols`/`rowSymbols`/`colSymbols`) tracked in +# https://github.com/SciML/LabelledArrays.jl/issues/205. JET likewise finds the +# `setfield!`-on-immutable-`LArray` dead branch in `setproperty!` (src/larray.jl) +# tracked in the same issue, so JET stays opt-out here (JET is not loaded). The +# remaining Aqua checks (incl. deps_compat) run and pass. +# +# ExplicitImports ignore-list (all_qualified_accesses_are_public): every entry is a +# non-public name from a dependency (or Base) that LabelledArrays must access by +# qualification because there is no public alternative — either a method-extension +# definition of a non-public function, or a non-public type/function used directly: +# @_propagate_inbounds_meta, print_array, dataids, BroadcastStyle, AbstractArrayStyle, +# Broadcasted -> Base / Base.Broadcast internals (broadcast + indexing machinery) +# @forward -> MacroTools (method forwarding) +# Dual -> ForwardDiff (DiffCache eltype) +# LU, size_tuple -> StaticArrays internals +# can_setindex, ismutable, restructure, undefmatrix -> ArrayInterface trait methods +# enlargediffcache! -> PreallocationTools internal +# The trailing four (@propagate_inbounds, OneTo, elsize, unsafe_convert) are Base names +# that are `public` on Julia 1.11+ but, because the `public` keyword predates the LTS, +# read as non-public to ExplicitImports on the 1.10 LTS — they are ignored only to keep +# the LTS QA lane green; on 1.11+ they are genuinely public. +run_qa( + LabelledArrays; + aqua_kwargs = (; ambiguities = false, unbound_args = false, undefined_exports = false, - deps_compat = false, - ) - @test_broken false # Aqua ambiguities: method ambiguities found — tracked in https://github.com/SciML/LabelledArrays.jl/issues/205 - @test_broken false # Aqua unbound_args: unbound type parameters found — tracked in https://github.com/SciML/LabelledArrays.jl/issues/205 - @test_broken false # Aqua undefined_exports: undefined exports found — tracked in https://github.com/SciML/LabelledArrays.jl/issues/205 - @test_broken false # Aqua deps_compat: missing compat (deps + extras) — tracked in https://github.com/SciML/LabelledArrays.jl/issues/205 -end - -@testset "JET" begin - # JET finds setfield! on immutable LArray in setproperty!(::LArray, ::Symbol, ::Any). - # Tracked in https://github.com/SciML/LabelledArrays.jl/issues/205 - @test_broken false # JET: setfield! immutable LArray in setproperty! (src/larray.jl:96) — tracked in https://github.com/SciML/LabelledArrays.jl/issues/205 -end + ), + explicit_imports = true, + ei_kwargs = (; + all_qualified_accesses_are_public = (; + ignore = ( + Symbol("@_propagate_inbounds_meta"), Symbol("@forward"), + :AbstractArrayStyle, :BroadcastStyle, :Broadcasted, :Dual, :LU, + :can_setindex, :dataids, :enlargediffcache!, :ismutable, :print_array, + :restructure, :size_tuple, :undefmatrix, + # public on 1.11+, read as non-public on the 1.10 LTS only: + Symbol("@propagate_inbounds"), :OneTo, :elsize, :unsafe_convert, + ), + ), + ), +)