-
-
Notifications
You must be signed in to change notification settings - Fork 465
Rename alias_method::WeightedIndex to WeightedAliasIndex #1008
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
I think it makes sense for |
Makes sense. What about the |
There's an issue on this linked in the 0.8 tracker: #763. Do we still want |
Note also that the |
I wonder if need to re-export those items from |
Sure, but is there a reason not to? The original design for |
pub use self::weighted::{WeightedError, WeightedIndex}; | ||
pub use rand::distributions::weighted::{WeightedError, WeightedIndex}; | ||
#[cfg(feature = "alloc")] | ||
pub use weighted_alias::WeightedAliasIndex; |
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.
Unfortunately this results in WeightedAliasIndex
being shown as re-exported item in documentation.
Ok, let's leave modules. If you don't hav any objections, I think this PR is ready for merge. |
There is a test failure:
|
Ouch, fixed. |
BTW it looks like CI does not properly test this crate with disabled default features (see use of |
Looks good, thanks! |
I think it makes things a bit more clear and simplifies module structure.
Also how about moving distributions from
weighted
anduniform
modules to top-level? It's a bit strange that only they stay in their own module, but not other distributions.