Skip to content

Commit daf9126

Browse files
authored
Merge pull request #20 from ranjanan/RA/depwarn
Fix deprecation warnings, remove v0.3 support
2 parents 3e666ec + 3688f32 commit daf9126

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ os:
33
- osx
44
- linux
55
julia:
6-
- 0.3
76
- 0.4
87
- nightly
98
notifications:

REQUIRE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
julia 0.3
2-
Compat
1+
julia 0.4
2+
Compat 0.8.4

src/SortingAlgorithms.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module SortingAlgorithms
22

33
using Compat
4+
import Compat.view
45
using Base.Sort
56
using Base.Order
67

@@ -22,7 +23,7 @@ const RadixSort = RadixSortAlg()
2223

2324
function sort!(v::AbstractVector, lo::Int, hi::Int, a::HeapSortAlg, o::Ordering)
2425
if lo > 1 || hi < length(v)
25-
return sort!(sub(v, lo:hi), 1, length(v), a, o)
26+
return sort!(view(v, lo:hi), 1, length(v), a, o)
2627
end
2728
r = ReverseOrdering(o)
2829
heapify!(v, r)
@@ -548,7 +549,7 @@ function sort!(v::AbstractVector, lo::Int, hi::Int, ::TimSortAlg, o::Ordering)
548549
else
549550
if !issorted(run_range)
550551
run_range = last(run_range):first(run_range)
551-
reverse!(sub(v, run_range))
552+
reverse!(view(v, run_range))
552553
end
553554
end
554555
# Push this run onto the queue and merge if needed

test/REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
StatsBase 0.9.0

test/runtests.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Base.Test
22
using SortingAlgorithms
33
using Compat
4+
using StatsBase
45

56
a = rand(1:10000, 1000)
67

@@ -56,14 +57,14 @@ srand(0xdeadbeef)
5657
for n in [0:10..., 100, 101, 1000, 1001]
5758
r = 1:10
5859
v = rand(1:10,n)
59-
h = hist(v,r)
60+
h = fit(Histogram, v, r)
6061

6162
for ord in [Base.Order.Forward, Base.Order.Reverse]
6263
# insertion sort (stable) as reference
6364
pi = sortperm(v, alg=InsertionSort, order=ord)
6465
@test isperm(pi)
6566
si = v[pi]
66-
@test hist(si,r) == h
67+
@test fit(Histogram, si, r) == h
6768
@test issorted(si, order=ord)
6869
@test all(issorted,[pi[si.==x] for x in r])
6970
c = copy(v)

0 commit comments

Comments
 (0)