Skip to content

Commit

Permalink
Merge pull request #233 from wookay/fix_floatrange
Browse files Browse the repository at this point in the history
fix deprecated FloatRange
  • Loading branch information
andreasnoack authored Feb 10, 2017
2 parents 36e5b01 + 4ee6633 commit ca89b28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/hist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ function histrange{F}(lo::F, hi::F, n::Integer, closed::Symbol=:right)
len += one(F)
end
end
FloatRange(start,step,len,divisor)
@static if VERSION < v"0.6.0-dev.2376" # Julia PR 18777
FloatRange(start,step,len,divisor)
else
Base.floatrange(start,step,len,divisor)
end
end

histrange{N}(vs::NTuple{N,AbstractVector},nbins::NTuple{N,Integer},closed::Symbol) =
Expand Down
2 changes: 1 addition & 1 deletion test/hist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ l,h = extrema(StatsBase.histrange([typemin(Int),typemax(Int)], 10))
# hist show
show_h = sprint(show, fit(Histogram,[1,2,3]))
@test contains(show_h, "edges:\n 0.0:1.0:3.0")
@test contains(show_h, "weights: [1,1,1]")
@test contains(show_h, string("weights: ", [1,1,1]))
@test contains(show_h, "closed: right")

0 comments on commit ca89b28

Please sign in to comment.