-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support RangeGeneratorInt rename #440
Conversation
Good to merge? |
Needs an entry in the README |
src/Compat.jl
Outdated
|
||
# Cope with renaming of RangeGeneratorInt to SamplerRangeInt | ||
@static if !isdefined(Base.Random, :SamplerRangeInt) | ||
SamplerRangeInt = Base.Random.RangeGeneratorInt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you want a const
here?
@@ -1063,6 +1063,8 @@ end | |||
@test Compat.notnothing(1) == 1 | |||
@test_throws ArgumentError Compat.notnothing(nothing) | |||
|
|||
@test isa(Base.Random.RangeGenerator(1:3), Compat.Random.SamplerRangeInt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Base.Random.RangeGenerator
has been kept as an alias for compatibility, but eventually it will go; but I guess this test is fine for now. Also, Random
will move to stdlib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the test should reference the obsolete name. Maybe
@test extrema([rand(Compat.Random.SamplerRangeInt(1:3)) for i=1:1000]) == (1,3)
This change looks good, do you have a link to an example where it would be used? It's possible that for |
This was designed for https://github.com/JuliaStats/Distributions.jl/pull/700/files. Happy to implement or defer to your implementation of a better approach; I just wanted to get Distributions.jl working again. |
I think we can go with your solution for now, and see if a better solution exists when things have stabilized after 1.0 is out. |
needs a rebase |
Any update on this? |
Updated on top of #601. The test of course fails on Julia past 0.7 as |
Closing as outdated since we've dropped support for Julia prior to 1.0. |
No description provided.