Skip to content

Ambiguity detection #269

Open
Open
@timholy

Description

@timholy

StatsBase has a number of ambiguities on 0.6:

julia> using StatsBase

julia> using Base.Test

julia> detect_ambiguities(StatsBase, Base, Core)
Skipping StatsBase.hist
Skipping StatsBase.wmean!
Skipping Base.<|
5-element Array{Tuple{Method,Method},1}:
 ((::Base.#kw##stdm)(::Array{Any,1}, ::Base.#stdm, v::AbstractArray{T,N} where N where T<:Real, m::AbstractArray{T,N} where N where T<:Real, dim::Int64) in StatsBase, (::Base.#kw##stdm)(::Array{Any,1}, ::Base.#stdm, v::AbstractArray{T,N} where N where T<:Real, w::StatsBase.AbstractWeights, m::Real) in StatsBase)                                                                 
 (stdm(v::AbstractArray{T,N} where N where T<:Real, w::StatsBase.AbstractWeights, m::Real) in StatsBase at /home/tim/.julia/v0.6/StatsBase/src/moments.jl:129, stdm(v::AbstractArray{T,N} where N where T<:Real, m::AbstractArray{T,N} where N where T<:Real, dim::Int64) in StatsBase at /home/tim/.julia/v0.6/StatsBase/src/moments.jl:153)                                             
 ((::Base.#kw##stdm)(::Array{Any,1}, ::Base.#stdm, v::AbstractArray{T,N} where N where T<:Real, w::StatsBase.AbstractWeights, m::Real) in StatsBase, (::Base.#kw##stdm)(::Array{Any,1}, ::Base.#stdm, v::AbstractArray{T,N} where N where T<:Real, m::AbstractArray{T,N} where N where T<:Real, dim::Int64) in StatsBase)                                                                 
 (varm(A::AbstractArray{T,N} where N where T<:Real, w::StatsBase.AbstractWeights, M::AbstractArray{T,N} where N where T<:Real, dim::Int64) in StatsBase at /home/tim/.julia/v0.6/StatsBase/src/moments.jl:87, varm(A::AbstractArray{T,N} where N where T<:Real, M::AbstractArray{T,N} where N where T<:Real, wv::StatsBase.AbstractWeights, dim::Int64) in StatsBase at deprecated.jl:50) 
 (stdm(v::AbstractArray{T,N} where N where T<:Real, w::StatsBase.AbstractWeights, m::AbstractArray{T,N} where N where T<:Real, dim::Int64) in StatsBase at /home/tim/.julia/v0.6/StatsBase/src/moments.jl:156, stdm(v::AbstractArray{T,N} where N where T<:Real, m::AbstractArray{T,N} where N where T<:Real, wv::StatsBase.AbstractWeights, dim::Int64) in StatsBase at deprecated.jl:50)

In several of my packages I make ambiguity detection part of the tests. Sometimes you want to "subtract" ambiguities caused by dependent packages. Here's an example. (Printing the ambiguities increases the interpretability of failures on Travis.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions