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

Move the deprecation of midpoints to 0.6 section, #20058

Merged
merged 1 commit into from
Jan 17, 2017
Merged
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
7 changes: 3 additions & 4 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,6 @@ function histrange{T<:Integer,N}(v::AbstractArray{T,N}, n::Integer)
start:step:(start + nm1*step)
end

## midpoints of intervals
midpoints(r::Range) = r[1:length(r)-1] + 0.5*step(r)
midpoints(v::AbstractVector) = [0.5*(v[i] + v[i+1]) for i in 1:length(v)-1]

## hist ##
function sturges(n) # Sturges' formula
depwarn("sturges(n) is deprecated, use StatsBase.sturges(n) instead.",:sturges)
Expand Down Expand Up @@ -1028,6 +1024,9 @@ export $

@deprecate is (===)

# midpoints of intervals
@deprecate midpoints(r::Range) r[1:length(r)-1] + 0.5*step(r)
@deprecate midpoints(v::AbstractVector) [0.5*(v[i] + v[i+1]) for i in 1:length(v)-1]

@deprecate_binding Filter Iterators.Filter
@deprecate_binding Zip Iterators.Zip
Expand Down
8 changes: 0 additions & 8 deletions base/docs/helpdb/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2219,14 +2219,6 @@ unsigned without checking for negative values.
"""
unsigned

"""
midpoints(e)

Compute the midpoints of the bins with edges `e`. The result is a vector/range of length
`length(e) - 1`. Note: Julia does not ignore `NaN` values in the computation.
"""
midpoints

"""
reverseind(v, i)

Expand Down
1 change: 0 additions & 1 deletion base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,6 @@ export
median!,
median,
middle,
midpoints,
quantile!,
quantile,
std,
Expand Down
1 change: 0 additions & 1 deletion doc/src/stdlib/math.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ Base.varm
Base.middle
Base.median
Base.median!
Base.midpoints
Base.quantile
Base.quantile!
Base.cov
Expand Down
5 changes: 0 additions & 5 deletions test/statistics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,6 @@ let tmp = linspace(1, 85, 100)
@test cor(tmp, tmp2) <= 1.0
end


@test midpoints(1.0:1.0:10.0) == 1.5:1.0:9.5
@test midpoints(1:10) == 1.5:9.5
@test midpoints(Float64[1.0:1.0:10.0;]) == Float64[1.5:1.0:9.5;]

@test quantile([1,2,3,4],0.5) == 2.5
@test quantile([1,2,3,4],[0.5]) == [2.5]
@test quantile([1., 3],[.25,.5,.75])[2] == median([1., 3])
Expand Down