diff --git a/README.md b/README.md index 18f8d1909..ef5c99575 100644 --- a/README.md +++ b/README.md @@ -75,9 +75,6 @@ Currently, the `@compat` macro supports the following syntaxes: * `using Compat.UUIDs` is provided on versions older than 0.7, where this library is not yet part of the standard library ([#25819]). -* `using Compat.Statistics` is provided on versions older than 0.7, where this library is - not yet part of the standard library ([#27834]). - ## New functions, macros, and methods * `mod` now accepts a unit range as the second argument ([#32628]). @@ -143,8 +140,8 @@ Currently, the `@compat` macro supports the following syntaxes: * `Compat.accumulate`, `Compat.accumulate!`, `Compat.all`, `Compat.any`, `Compat.cumprod`, `Compat.cumprod!`, `Compat.cumsum`, `Compat.cumsum!`, - `Compat.findmax`, `Compat.findmin`, `Compat.mapreduce`, `Compat.maximum`, `Compat.Statistics.mean`, - `Compat.Statistics.median`, `Compat.minimum`, `Compat.prod`, `Compat.reduce`, `Compat.sort`, + `Compat.findmax`, `Compat.findmin`, `Compat.mapreduce`, `Compat.maximum`, + `Compat.minimum`, `Compat.prod`, `Compat.reduce`, `Compat.sort`, and `Compat.sum` with `dims` keyword argument ([#25989],[#26369]). * `Compat.mapreduce` and `Compat.reduce` with `init` keyword argument ([#27711]). diff --git a/src/Compat.jl b/src/Compat.jl index f794d07cd..ba8a02579 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -30,41 +30,11 @@ import Random import Markdown import REPL import Serialization +import Statistics include("compatmacro.jl") -if VERSION < v"0.7.0-beta.85" - @eval module Statistics - if VERSION < v"0.7.0-DEV.4064" - varm(A::AbstractArray, m; dims=nothing, kwargs...) = - dims===nothing ? Base.varm(A, m; kwargs...) : Base.varm(A, m, dims; kwargs...) - if VERSION < v"0.7.0-DEV.755" - cov(a::AbstractMatrix; dims=1, corrected=true) = Base.cov(a, dims, corrected) - cov(a::AbstractVecOrMat, b::AbstractVecOrMat; dims=1, corrected=true) = - Base.cov(a, b, dims, corrected) - else - cov(a::AbstractMatrix; dims=nothing, kwargs...) = - dims===nothing ? Base.cov(a; kwargs...) : Base.cov(a, dims; kwargs...) - cov(a::AbstractVecOrMat, b::AbstractVecOrMat; dims=nothing, kwargs...) = - dims===nothing ? Base.cov(a, b; kwargs...) : Base.cov(a, b, dims; kwargs...) - end - cor(a::AbstractMatrix; dims=nothing) = dims===nothing ? Base.cor(a) : Base.cor(a, dims) - cor(a::AbstractVecOrMat, b::AbstractVecOrMat; dims=nothing) = - dims===nothing ? Base.cor(a, b) : Base.cor(a, b, dims) - mean(a::AbstractArray; dims=nothing) = dims===nothing ? Base.mean(a) : Base.mean(a, dims) - median(a::AbstractArray; dims=nothing) = dims===nothing ? Base.median(a) : Base.median(a, dims) - var(a::AbstractArray; dims=nothing, kwargs...) = - dims===nothing ? Base.var(a; kwargs...) : Base.var(a, dims; kwargs...) - std(a::AbstractArray; dims=nothing, kwargs...) = - dims===nothing ? Base.std(a; kwargs...) : Base.std(a, dims; kwargs...) - end - export cor, cov, std, stdm, var, varm, mean!, mean, median!, median, middle, quantile!, quantile - end -else - import Statistics -end - @static if VERSION < v"0.7.0-DEV.4592" struct Fix2{F,T} <: Function f::F