Skip to content

Commit

Permalink
Mark Compat.Statistics from #583 for deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 4, 2019
1 parent 6638586 commit 1257f8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 36 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]).
Expand Down Expand Up @@ -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]).
Expand Down
32 changes: 1 addition & 31 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1257f8a

Please sign in to comment.