Skip to content

Commit ef7b9fd

Browse files
fix depwarns
1 parent 93dc1ac commit ef7b9fd

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/PoissonRandom.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ __precompile__()
22

33
module PoissonRandom
44

5+
using Random
56

6-
function count_rand(λ,rng::AbstractRNG=Base.GLOBAL_RNG)
7+
function count_rand(λ,rng::AbstractRNG=Random.GLOBAL_RNG)
78
n = 0
89
c = randexp(rng)
910
while c < λ
@@ -21,7 +22,7 @@ end
2122
#
2223
# For μ sufficiently large, (i.e. >= 10.0)
2324
#
24-
function ad_rand(λ,rng::AbstractRNG=Base.GLOBAL_RNG)
25+
function ad_rand(λ,rng::AbstractRNG=Random.GLOBAL_RNG)
2526
s = sqrt(λ)
2627
d = 6.0*λ^2
2728
L = floor(Int,λ-1.1484)

test/runtests.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using PoissonRandom
22
import Distributions
3-
using Test
3+
using Test, Statistics
44

55
n_tsamples = 10^5
66

@@ -33,14 +33,14 @@ function test_samples(rand_func,
3333
rmin = floor(Int,quantile(distr, 0.00001))::Int
3434
rmax = floor(Int,quantile(distr, 0.99999))::Int
3535
m = rmax - rmin + 1 # length of the range
36-
p0 = Distributions.pdf.(distr, rmin:rmax) # reference probability masses
36+
p0 = Distributions.pdf.((distr,), rmin:rmax) # reference probability masses
3737
@assert length(p0) == m
3838

3939
# determine confidence intervals for counts:
4040
# with probability q, the count will be out of this interval.
4141
#
42-
clb = Vector{Int}(m)
43-
cub = Vector{Int}(m)
42+
clb = Vector{Int}(undef,m)
43+
cub = Vector{Int}(undef,m)
4444
for i = 1:m
4545
bp = Distributions.Binomial(n, p0[i])
4646
clb[i] = floor(Int,quantile(bp, q/2))

0 commit comments

Comments
 (0)