Skip to content

Commit 64cc589

Browse files
authored
Merge pull request #643 from JuliaCollections/ox/break
Mark as 0.18-DEV and remove deprecations
2 parents a60cd18 + 9c11640 commit 64cc589

18 files changed

+22
-210
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DataStructures"
22
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
3-
version = "0.17.20"
3+
version = "0.18.0-DEV"
44

55
[deps]
66
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

docs/src/heaps.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ isempty(h) # returns whether the heap is empty
1515

1616
push!(h, v) # add a value to the heap
1717

18-
top(h) # return the top value of a heap
18+
first(h) # return the first (top) value of a heap
1919

20-
pop!(h) # removes the top value, and returns it
20+
pop!(h) # removes the first (top) value, and returns it
2121

2222
```
2323

@@ -73,7 +73,7 @@ popmax!(h, k) # remove and return the largest k elements
7373
popall!(h) # remove and return all the elements, sorted smallest to largest
7474
popall!(h, o) # remove and return all the elements according to ordering o
7575
```
76-
The usual `top(h)` and `pop!(h)` are defined to be `minimum(h)` and `popmin!(h)`,
76+
The usual `first(h)` and `pop!(h)` are defined to be `minimum(h)` and `popmin!(h)`,
7777
respectively.
7878

7979
This package includes an implementation of a binary min-max heap (`BinaryMinMaxHeap`).

src/DataStructures.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ module DataStructures
2727
export capacity, num_blocks, top_with_handle, sizehint!
2828

2929
export Accumulator, counter, reset!, inc!, dec!
30-
31-
export ClassifiedCollections
32-
export classified_lists, classified_sets, classified_counters
33-
3430
export IntDisjointSets, DisjointSets, num_groups, find_root!, in_same_set, root_union!
35-
3631
export FenwickTree, length, inc!, dec!, incdec!, prefixsum
3732

3833
export AbstractHeap, compare, extract_all!
@@ -70,7 +65,6 @@ module DataStructures
7065
include("stack.jl")
7166
include("queue.jl")
7267
include("accumulator.jl")
73-
include("classified_collections.jl")
7468
include("disjoint_set.jl")
7569
include("heaps.jl")
7670

src/classified_collections.jl

Lines changed: 0 additions & 55 deletions
This file was deleted.

src/default_dict.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ DefaultDictBase{K,V}(default::F; kwargs...) where {K,V,F} = DefaultDictBase{K,V,
5959
@delegate_return_parent DefaultDictBase.d [ delete!, empty!, setindex!, sizehint! ]
6060

6161
empty(d::DefaultDictBase{K,V,F}) where {K,V,F} = DefaultDictBase{K,V,F}(d.default; passkey=d.passkey)
62-
@deprecate similar(d::DefaultDictBase) empty(d)
6362

6463
getindex(d::DefaultDictBase, key) = get!(d.d, key, d.default)
6564

@@ -144,8 +143,6 @@ for _Dict in [:Dict, :OrderedDict]
144143

145144
empty(d::$DefaultDict{K,V,F}) where {K,V,F} = $DefaultDict{K,V,F}(d.d.default)
146145
in(key, v::Base.KeySet{K,T}) where {K,T<:$DefaultDict{K}} = key in keys(v.dict.d.d)
147-
148-
@deprecate similar(d::$DefaultDict) empty(d)
149146
end
150147
end
151148

src/deprecations.jl

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
@deprecate front(x) first(x)
2-
@deprecate back(x) last(x)
3-
@deprecate top(x) first(x)
4-
#@deprecate find_root find_root! # 2020-03-31 - deprecate in v0.18, or when Julia 1.5 is released.
5-
export find_root
6-
const find_root = find_root!
7-
8-
@deprecate deque(::Type{T}) where {T} Deque{T}()
9-
10-
@deprecate path(t::Trie, str::AbstractString) partial_path(t::Trie, str::AbstractString)
1+
# 0.18 deprecations. Remove before releasing 0.19
2+
@deprecate path(t::Trie, str::AbstractString) partial_path(t::Trie, str::AbstractString)
3+
@deprecate find_root find_root!

src/heaps.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
#
2525
# - sizehint!(h, s) set size hint to a heap
2626
#
27-
# - top(h) return the top value of a heap
27+
# - first(h) return the first (top) value of a heap
2828
#
29-
# - pop!(h) removes the top value, and
29+
# - pop!(h) removes the first (top) value, and
3030
# returns it
3131
#
3232
# For mutable heaps, it should also support
@@ -113,7 +113,7 @@ function nextreme(comp::Comp, n::Int, arr::AbstractVector{T}) where {T, Comp}
113113

114114
for i = n + 1 : length(arr)
115115
@inbounds xi = arr[i]
116-
if compare(comp, top(buffer), xi)
116+
if compare(comp, first(buffer), xi)
117117
# This could use a pushpop method
118118
pop!(buffer)
119119
push!(buffer, xi)

src/heaps/binary_heap.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ function sizehint!(h::BinaryHeap, s::Integer)
144144
end
145145

146146
"""
147-
top(h::BinaryHeap)
147+
first(h::BinaryHeap)
148148
149149
Returns the element at the top of the heap `h`.
150150
"""
151-
@inline top(h::BinaryHeap) = h.valtree[1]
151+
@inline first(h::BinaryHeap) = h.valtree[1]
152152

153153
pop!(h::BinaryHeap{T}) where {T} = _binary_heap_pop!(h.comparer, h.valtree)

src/heaps/minmax_heap.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,11 @@ function push!(h::BinaryMinMaxHeap, v)
244244
end
245245

246246
"""
247-
top(h::BinaryMinMaxHeap)
247+
first(h::BinaryMinMaxHeap)
248248
249-
Get the top (minimum) of the heap.
249+
Get the first (minimum) of the heap.
250250
"""
251-
@inline top(h::BinaryMinMaxHeap) = minimum(h)
251+
@inline first(h::BinaryMinMaxHeap) = minimum(h)
252252

253253
@inline function minimum(h::BinaryMinMaxHeap)
254254
valtree = h.valtree

src/heaps/mutable_binary_heap.jl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,6 @@ const MutableBinaryMaxHeap{T} = MutableBinaryHeap{T, GreaterThan}
178178
MutableBinaryMinHeap(xs::AbstractVector{T}) where T = MutableBinaryMinHeap{T}(xs)
179179
MutableBinaryMaxHeap(xs::AbstractVector{T}) where T = MutableBinaryMaxHeap{T}(xs)
180180

181-
# deprecated constructors
182-
183-
@deprecate mutable_binary_minheap(::Type{T}) where {T} MutableBinaryMinHeap{T}()
184-
@deprecate mutable_binary_minheap(xs::AbstractVector{T}) where {T} MutableBinaryMinHeap(xs)
185-
@deprecate mutable_binary_maxheap(::Type{T}) where {T} MutableBinaryMaxHeap{T}()
186-
@deprecate mutable_binary_maxheap(xs::AbstractVector{T}) where {T} MutableBinaryMaxHeap(xs)
187-
188-
189181
function show(io::IO, h::MutableBinaryHeap)
190182
print(io, "MutableBinaryHeap(")
191183
nodes = h.nodes
@@ -227,7 +219,7 @@ function sizehint!(h::MutableBinaryHeap, s::Integer)
227219
return h
228220
end
229221

230-
@inline top(h::MutableBinaryHeap) = h.nodes[1].value
222+
@inline first(h::MutableBinaryHeap) = h.nodes[1].value
231223

232224
"""
233225
top_with_handle(h::MutableBinaryHeap)

0 commit comments

Comments
 (0)