DescriptorSystems.jl icon indicating copy to clipboard operation
DescriptorSystems.jl copied to clipboard

Type piracy issues

Open andreasvarga opened this issue 1 year ago • 1 comments

I am facing the following type piracy issue when testing with Aqua:

julia> using DescriptorSystems

julia> using Aqua

julia> Aqua.test_piracies(DescriptorSystems)
Possible type-piracy detected:
[1] hcat(A::Union{Number, DescriptorStateSpace, LinearAlgebra.UniformScaling, AbstractVecOrMat}...) @ DescriptorSystems C:\Users\Andreas\Documents\software\Julia\DescriptorSystems.jl\src\connections.jl:220
[2] hvcat(rows::Tuple{Vararg{Int64}}, A::Union{Number, DescriptorStateSpace, LinearAlgebra.UniformScaling, AbstractVecOrMat}...) @ DescriptorSystems C:\Users\Andreas\Documents\software\Julia\DescriptorSystems.jl\src\connections.jl:260
[3] vcat(A::Union{Number, DescriptorStateSpace, LinearAlgebra.UniformScaling, AbstractVecOrMat}...) @ DescriptorSystems C:\Users\Andreas\Documents\software\Julia\DescriptorSystems.jl\src\connections.jl:220
Test Failed at C:\Users\Andreas\.julia\packages\Aqua\9p8ck\src\piracies.jl:232
  Expression: isempty(v)
   Evaluated: isempty(Method[hcat(A::Union{Number, DescriptorStateSpace, LinearAlgebra.UniformScaling, AbstractVecOrMat}...) @ DescriptorSystems C:\Users\Andreas\Documents\software\Julia\DescriptorSystems.jl\src\connections.jl:220, hvcat(rows::Tuple{Vararg{Int64}}, A::Union{Number, DescriptorStateSpace, LinearAlgebra.UniformScaling, AbstractVecOrMat}...) @ DescriptorSystems C:\Users\Andreas\Documents\software\Julia\DescriptorSystems.jl\src\connections.jl:260, vcat(A::Union{Number, DescriptorStateSpace, LinearAlgebra.UniformScaling, AbstractVecOrMat}...) @ DescriptorSystems C:\Users\Andreas\Documents\software\Julia\DescriptorSystems.jl\src\connections.jl:220])

ERROR: There was an error during testing

The implementation of hcat, vcat and hvcat operations on the DescriptorStateSpace structure should be similar to that employed in the LinearMaps package, which is apparently fully Aqua compliant. I wonder how this compliance can be enforced also for this package. Any help is welcome @dkarrasch.

andreasvarga avatar Jan 23 '24 09:01 andreasvarga

To be honest, LinearMaps.jl is not fully compliant. The type piracy check is broken, see

https://github.com/JuliaLinearAlgebra/LinearMaps.jl/blob/master/test/runtests.jl

for how to "fix" this.

dkarrasch avatar Jan 23 '24 09:01 dkarrasch