Skip to content

Commit 7e11e9d

Browse files
authored
Move the deprecation of midpoints to 0.6 section, (#20058)
and actually deprecate it - this was moved to deprecated.jl in #16450, but not actually deprecated
1 parent a1f232e commit 7e11e9d

File tree

5 files changed

+3
-19
lines changed

5 files changed

+3
-19
lines changed

base/deprecated.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -592,10 +592,6 @@ function histrange{T<:Integer,N}(v::AbstractArray{T,N}, n::Integer)
592592
start:step:(start + nm1*step)
593593
end
594594

595-
## midpoints of intervals
596-
midpoints(r::Range) = r[1:length(r)-1] + 0.5*step(r)
597-
midpoints(v::AbstractVector) = [0.5*(v[i] + v[i+1]) for i in 1:length(v)-1]
598-
599595
## hist ##
600596
function sturges(n) # Sturges' formula
601597
depwarn("sturges(n) is deprecated, use StatsBase.sturges(n) instead.",:sturges)
@@ -1028,6 +1024,9 @@ export $
10281024

10291025
@deprecate is (===)
10301026

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

10321031
@deprecate_binding Filter Iterators.Filter
10331032
@deprecate_binding Zip Iterators.Zip

base/docs/helpdb/Base.jl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,14 +2219,6 @@ unsigned without checking for negative values.
22192219
"""
22202220
unsigned
22212221

2222-
"""
2223-
midpoints(e)
2224-
2225-
Compute the midpoints of the bins with edges `e`. The result is a vector/range of length
2226-
`length(e) - 1`. Note: Julia does not ignore `NaN` values in the computation.
2227-
"""
2228-
midpoints
2229-
22302222
"""
22312223
reverseind(v, i)
22322224

base/exports.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,6 @@ export
886886
median!,
887887
median,
888888
middle,
889-
midpoints,
890889
quantile!,
891890
quantile,
892891
std,

doc/src/stdlib/math.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ Base.varm
232232
Base.middle
233233
Base.median
234234
Base.median!
235-
Base.midpoints
236235
Base.quantile
237236
Base.quantile!
238237
Base.cov

test/statistics.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,6 @@ let tmp = linspace(1, 85, 100)
317317
@test cor(tmp, tmp2) <= 1.0
318318
end
319319

320-
321-
@test midpoints(1.0:1.0:10.0) == 1.5:1.0:9.5
322-
@test midpoints(1:10) == 1.5:9.5
323-
@test midpoints(Float64[1.0:1.0:10.0;]) == Float64[1.5:1.0:9.5;]
324-
325320
@test quantile([1,2,3,4],0.5) == 2.5
326321
@test quantile([1,2,3,4],[0.5]) == [2.5]
327322
@test quantile([1., 3],[.25,.5,.75])[2] == median([1., 3])

0 commit comments

Comments
 (0)