Skip to content

Failed type assertion in pairwise #771

Closed
@yha

Description

@yha
using HypothesisTests, StatsBase
function test(x)
	pairwise(eachindex(x); symmetric=true) do j,i
		pval = pvalue(SignedRankTest(x[i], x[j]))
		pval, rand()
	end
end

x = [rand(1000) for _=1:10]

test(x)
ERROR: TypeError: in typeassert, expected Matrix{<:Tuple{Union{Nothing, Float64, Int64}, Float64}}, got a value of type Matrix{Tuple{Real, Float64}}
Stacktrace:
 [1] _pairwise(#unused#::Val{:none}, f::var"#29#30"{Vector{Vector{Float64}}}, x::Base.OneTo{Int64}, y::Base.OneTo{Int64}, symmetric::Bool)
   @ StatsBase C:\Users\sternlab\.julia\packages\StatsBase\pJqvO\src\pairwise.jl:155
 [2] pairwise(f::Function, x::Base.OneTo{Int64}, y::Base.OneTo{Int64}; symmetric::Bool, skipmissing::Symbol)
   @ StatsBase C:\Users\sternlab\.julia\packages\StatsBase\pJqvO\src\pairwise.jl:288
 [3] test(x::Vector{Vector{Float64}})
   @ Main .\Untitled-9:3
 [4] top-level scope
   @ Untitled-9:11

Package versions:

  [09f84164] HypothesisTests v0.10.6
  [2913bbd2] StatsBase v0.33.16

(this doesn't happen if the pairwise call is in global scope rather than a function)

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