Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method ambiguities reported by Aqua #95

Open
prbzrg opened this issue Dec 27, 2023 · 1 comment
Open

Method ambiguities reported by Aqua #95

prbzrg opened this issue Dec 27, 2023 · 1 comment

Comments

@prbzrg
Copy link

prbzrg commented Dec 27, 2023

In Julia v1.10, I used Aqua to detect method ambiguities in my package impICNF/ContinuousNormalizingFlows.jl#356 and some of its report were related to this package:

Ambiguity #1
<(a::SentinelArrays.ChainedVectorIndex, b::Integer) @ SentinelArrays ~/.julia/packages/SentinelArrays/1kRo4/src/chainedvector.jl:207
<(i::Integer, x::BigInt) @ Base.GMP gmp.jl:737

Possible fix, define
  <(::SentinelArrays.ChainedVectorIndex, ::BigInt)

Ambiguity #2
<(a::Integer, b::SentinelArrays.ChainedVectorIndex) @ SentinelArrays ~/.julia/packages/SentinelArrays/1kRo4/src/chainedvector.jl:208
<(x::BigInt, i::Integer) @ Base.GMP gmp.jl:736

Possible fix, define
  <(::BigInt, ::SentinelArrays.ChainedVectorIndex)

Ambiguity #3
<=(a::SentinelArrays.ChainedVectorIndex, b::Integer) @ SentinelArrays ~/.julia/packages/SentinelArrays/1kRo4/src/chainedvector.jl:207
<=(i::Integer, x::BigInt) @ Base.GMP gmp.jl:731

Possible fix, define
  <=(::SentinelArrays.ChainedVectorIndex, ::BigInt)

Ambiguity #4
<=(a::Integer, b::SentinelArrays.ChainedVectorIndex) @ SentinelArrays ~/.julia/packages/SentinelArrays/1kRo4/src/chainedvector.jl:208
<=(x::BigInt, i::Integer) @ Base.GMP gmp.jl:730

Possible fix, define
  <=(::BigInt, ::SentinelArrays.ChainedVectorIndex)

Ambiguity #9
==(a::Integer, b::SentinelArrays.ChainedVectorIndex) @ SentinelArrays ~/.julia/packages/SentinelArrays/1kRo4/src/chainedvector.jl:208
==(x::BigInt, i::Integer) @ Base.GMP gmp.jl:722

Possible fix, define
  ==(::BigInt, ::SentinelArrays.ChainedVectorIndex)

Ambiguity #12
==(a::SentinelArrays.ChainedVectorIndex, b::Integer) @ SentinelArrays ~/.julia/packages/SentinelArrays/1kRo4/src/chainedvector.jl:207
==(i::Integer, x::BigInt) @ Base.GMP gmp.jl:723

Possible fix, define
  ==(::SentinelArrays.ChainedVectorIndex, ::BigInt)

Ambiguity #51
broadcasted(f::F, A::SentinelArrays.ChainedVector) where F @ SentinelArrays ~/.julia/packages/SentinelArrays/1kRo4/src/chainedvector.jl:932
broadcasted(style::Base.Broadcast.BroadcastStyle, f::F, args...) where F @ Base.Broadcast broadcast.jl:1349

Possible fix, define
  broadcasted(::F, ::F) where {F<:SentinelArrays.ChainedVector, F<:Base.Broadcast.BroadcastStyle}

Ambiguity #64
copyto!(dest::AbstractVector, src::SentinelArrays.ChainedVector) @ SentinelArrays ~/.julia/packages/SentinelArrays/1kRo4/src/chainedvector.jl:384
copyto!(dest::PermutedDimsArray, src::AbstractArray) @ Base.PermutedDimsArrays permuteddimsarray.jl:234

Possible fix, define
  copyto!(::PermutedDimsArray{T, 1} where T, ::SentinelArrays.ChainedVector)

Ambiguity #68
copyto!(dest::AbstractVector, src::SentinelArrays.ChainedVector) @ SentinelArrays ~/.julia/packages/SentinelArrays/1kRo4/src/chainedvector.jl:384
copyto!(dest::PermutedDimsArray{T, N}, src::AbstractArray{T, N}) where {T, N} @ Base.PermutedDimsArrays permuteddimsarray.jl:230

Possible fix, define
  copyto!(::PermutedDimsArray{T, 1}, ::SentinelArrays.ChainedVector{T, A} where A<:AbstractVector{T}) where T

Ambiguity #76
findall(f::Function, x::SentinelArrays.ChainedVector) @ SentinelArrays ~/.julia/packages/SentinelArrays/1kRo4/src/chainedvector.jl:905
findall(pred::Base.Fix2{typeof(in)}, x::AbstractArray) @ Base array.jl:2617

Possible fix, define
  findall(::Base.Fix2{typeof(in)}, ::SentinelArrays.ChainedVector)

Ambiguity #95
reduce(op::OP, x::SentinelArrays.ChainedVector) where OP @ SentinelArrays ~/.julia/packages/SentinelArrays/1kRo4/src/chainedvector.jl:781
reduce(::typeof(hcat), A::AbstractVector{<:AbstractVecOrMat}) @ Base abstractarray.jl:1718

Possible fix, define
  reduce(::typeof(hcat), ::SentinelArrays.ChainedVector{T, A} where {T<:(AbstractVecOrMat), A<:AbstractVector{T}})

Ambiguity #96
reduce(op::OP, x::SentinelArrays.ChainedVector) where OP @ SentinelArrays ~/.julia/packages/SentinelArrays/1kRo4/src/chainedvector.jl:781
reduce(::typeof(vcat), A::AbstractVector{<:AbstractVecOrMat}) @ Base abstractarray.jl:1715

Possible fix, define
  reduce(::typeof(vcat), ::SentinelArrays.ChainedVector{T, A} where {T<:(AbstractVecOrMat), A<:AbstractVector{T}})

I would appreciate your attention to this issue.

@hhaensel
Copy link

hhaensel commented May 3, 2024

I encountered similar issues, when testing my new package StippleKeplerGL, which has SentinelArrays via CSV as dependency. My current workaround is.

let exclude = [Base.:<, Base.:<= , Base.:(==), Base.broadcasted, Base.unsafe_convert, Base.Sort.defalg, copyto!, push!, findall, lstrip, rstrip, push!, reduce]
    Aqua.test_all(StippleKeplerGL, ambiguities=(; exclude))
end

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

No branches or pull requests

2 participants