From 714cd0741b06034d2d6b9e086e0daff3b7d51cec Mon Sep 17 00:00:00 2001 From: MasonProtter Date: Thu, 14 May 2026 13:25:01 +0200 Subject: [PATCH 1/2] fix forwarding of `beta` kwarg in `quantile!(::AbstractArray...)` --- src/Statistics.jl | 4 ++-- test/runtests.jl | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Statistics.jl b/src/Statistics.jl index c8272cd..80d0c96 100644 --- a/src/Statistics.jl +++ b/src/Statistics.jl @@ -1013,11 +1013,11 @@ function quantile!(v::AbstractVector, p::Union{AbstractArray, Tuple{Vararg{Real} end quantile!(a::AbstractArray, p::Union{AbstractArray,Tuple{Vararg{Real}}}; sorted::Bool=false, alpha::Real=1.0, beta::Real=alpha) = - quantile!(vec(a), p, sorted=sorted, alpha=alpha, beta=alpha) + quantile!(vec(a), p, sorted=sorted, alpha=alpha, beta=beta) quantile!(q::AbstractArray, a::AbstractArray, p::Union{AbstractArray,Tuple{Vararg{Real}}}; sorted::Bool=false, alpha::Real=1.0, beta::Real=alpha) = - quantile!(q, vec(a), p, sorted=sorted, alpha=alpha, beta=alpha) + quantile!(q, vec(a), p, sorted=sorted, alpha=alpha, beta=beta) quantile!(v::AbstractVector, p::Real; sorted::Bool=false, alpha::Real=1.0, beta::Real=alpha) = _quantile(_quantilesort!(v, sorted, p, p), p, alpha=alpha, beta=beta) diff --git a/test/runtests.jl b/test/runtests.jl index 55d4414..2230725 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -820,6 +820,10 @@ end @test [quantile(1:10, i/9) for i in 0:9] == 1:10 @test [quantile(1:14, i/13) for i in 0:13] == 1:14 end + # Statistics issue 204 + @testset "vector and abstract array methods should agree" begin + @test quantile!(reshape([1.,2,3,4,5],5,1), [.25,.5,.75]; alpha=0, beta=1) ≈ [1.25, 2.5, 3.75] + end end # StatsBase issue 164 From 67f838b3c49e530f70978a7ce0ebc1532b5253f5 Mon Sep 17 00:00:00 2001 From: Milan Bouchet-Valat Date: Fri, 15 May 2026 09:40:15 +0200 Subject: [PATCH 2/2] Add empty line --- test/runtests.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/runtests.jl b/test/runtests.jl index 2230725..e7cda5c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -820,6 +820,7 @@ end @test [quantile(1:10, i/9) for i in 0:9] == 1:10 @test [quantile(1:14, i/13) for i in 0:13] == 1:14 end + # Statistics issue 204 @testset "vector and abstract array methods should agree" begin @test quantile!(reshape([1.,2,3,4,5],5,1), [.25,.5,.75]; alpha=0, beta=1) ≈ [1.25, 2.5, 3.75]