Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Return basic statistics to Base #27375

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,8 @@ Deprecated or removed

* `signif` has been deprecated in favor of the `sigdigits` keyword argument to `round`.

* `linreg` has been moved to the package StatsBase ([#27152]).

* `setrounding` has been deprecated for `Float32` and `Float64`, as the behaviour was too unreliable ([#26935]).

Command-line option changes
Expand Down Expand Up @@ -1581,6 +1583,7 @@ Command-line option changes
[#27075]: https://github.com/JuliaLang/julia/issues/27075
[#27100]: https://github.com/JuliaLang/julia/issues/27100
[#27121]: https://github.com/JuliaLang/julia/issues/27121
[#27152]: https://github.com/JuliaLang/julia/issues/27152
[#27159]: https://github.com/JuliaLang/julia/issues/27159
[#27164]: https://github.com/JuliaLang/julia/issues/27164
[#27189]: https://github.com/JuliaLang/julia/issues/27189
Expand Down
24 changes: 15 additions & 9 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ deprecate(Base, :DSP, 2)
using .DSP
export conv, conv2, deconv, filt, filt!, xcorr

# PR #21709
@deprecate cov(x::AbstractVector, corrected::Bool) cov(x, corrected=corrected)
@deprecate cov(x::AbstractMatrix, vardim::Int, corrected::Bool) cov(x, dims=vardim, corrected=corrected)
@deprecate cov(X::AbstractVector, Y::AbstractVector, corrected::Bool) cov(X, Y, corrected=corrected)
@deprecate cov(X::AbstractVecOrMat, Y::AbstractVecOrMat, vardim::Int, corrected::Bool) cov(X, Y, dims=vardim, corrected=corrected)

# PR #22325
# TODO: when this replace is removed from deprecated.jl:
# 1) rename the function replace_new from strings/util.jl to replace
Expand Down Expand Up @@ -1367,6 +1373,13 @@ export readandwrite
@deprecate findmin(A::AbstractArray, dims) findmin(A, dims=dims)

@deprecate mean(A::AbstractArray, dims) mean(A, dims=dims)
@deprecate varm(A::AbstractArray, m::AbstractArray, dims; kwargs...) varm(A, m; kwargs..., dims=dims)
@deprecate var(A::AbstractArray, dims; kwargs...) var(A; kwargs..., dims=dims)
@deprecate std(A::AbstractArray, dims; kwargs...) std(A; kwargs..., dims=dims)
@deprecate cov(X::AbstractMatrix, dim::Int; kwargs...) cov(X; kwargs..., dims=dim)
@deprecate cov(x::AbstractVecOrMat, y::AbstractVecOrMat, dim::Int; kwargs...) cov(x, y; kwargs..., dims=dim)
@deprecate cor(X::AbstractMatrix, dim::Int) cor(X, dims=dim)
@deprecate cor(x::AbstractVecOrMat, y::AbstractVecOrMat, dim::Int) cor(x, y, dims=dim)
@deprecate median(A::AbstractArray, dims; kwargs...) median(A; kwargs..., dims=dims)

@deprecate mapreducedim(f, op, A::AbstractArray, dims) mapreduce(f, op, A, dims=dims)
Expand Down Expand Up @@ -1687,21 +1700,14 @@ function Rounding.setrounding(::Type{T}, r::RoundingMode) where {T<:Union{Float3
Rounding.setrounding_raw(T, Rounding.to_fenv(r))
end

# #27140, #27152
@deprecate_moved cor "StatsBase"
@deprecate_moved cov "StatsBase"
@deprecate_moved std "StatsBase"
@deprecate_moved stdm "StatsBase"
@deprecate_moved var "StatsBase"
@deprecate_moved varm "StatsBase"
@deprecate_moved linreg "StatsBase"

# issue #27093
# in src/jlfrontend.scm a call to `@deprecate` is generated for per-module `eval(m, x)`
@eval Core Main.Base.@deprecate(eval(e), Core.eval(Main, e))

@eval @deprecate $(Symbol("@schedule")) $(Symbol("@async"))

@deprecate_moved linreg "StatsBase"

# END 0.7 deprecations

# BEGIN 1.0 deprecations
Expand Down
6 changes: 6 additions & 0 deletions base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -633,13 +633,19 @@ export
set_zero_subnormals,

# statistics
cor,
cov,
mean!,
mean,
median!,
median,
middle,
quantile!,
quantile,
std,
stdm,
var,
varm,

# iteration
done,
Expand Down
Loading