Closed Arkoniak closed 4 years ago
Thanks for the report!
I get an error on the call to sample
:
julia> sample(rng, 1:150, ws, 100)[1:5]
ERROR: MethodError: no method matching sample(::LehmerRNG, ::UnitRange{Int64}, ::Array{Float64,1}, ::Int64)
Closest candidates are:
sample(::Random.AbstractRNG, ::AbstractArray{T,N} where N, ::AbstractWeights, ::Integer; replace, ordered) where T
[...]
Can you reproduce the bug in a fresh Julia session without loading your startup.jl file? (julia --startup-file=no
)
Sorry, it was a typo, it should have been wsample
. Fixed description.
Ok, I found the problem: StatsBase uses RangeGenerator
in alias_sample!
, which is probably a legacy from the pre-Julia-1.0 era. RangeGenerator
in turn has changed its result in version 1.5. I will make a PR to StatsBase
fixing this. Thanks again!
This should now be fixed in StatsBase
(on master).
I've found this strange behavior, not sure where the problem is.
Julia 1.4.1
Julia nightly (Version 1.5.0-DEV.873 (2020-05-07), Commit d4d930399c (0 days old master))
In both Julia versions