Skip to content

Update ndarray-rand to rand 0.5.0 #456

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

Merged
merged 1 commit into from
May 28, 2018

Conversation

jturner314
Copy link
Member

This PR tries to replicate the old behavior as closely as possible.

This PR removes support for Sample and IndependentSample, which are deprecated in rand 0.5.0, and replaces them with the new Distribution trait.

Fixes #455.

Copy link
Collaborator

@nilgoyette nilgoyette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

Sh: ShapeBuilder<Dim=D>,
{
Self::random_using(shape, dist, &mut rand::weak_rng())
let mut rng = SmallRng::from_rng(thread_rng())
.unwrap_or_else(|err| panic!("create SmallRng from thread_rng failed: {:?}", err));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the same as expect("create SmallRng from thread_rng failed")? The way I understand the documentation, I believe it is equivalent. If so, I think we should prefer expect.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right. I just made that change. Thanks.

@jturner314 jturner314 merged commit 6d9a44d into rust-ndarray:master May 28, 2018
@jturner314
Copy link
Member Author

No one has objected to this PR, so I've merged it.

@jturner314 jturner314 deleted the rand-0.5 branch May 28, 2018 22:55
@jturner314
Copy link
Member Author

By the way, @nilgoyette thanks for reviewing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ndarray-rand 0.5
2 participants