-
Notifications
You must be signed in to change notification settings - Fork 310
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
ndarray-rand #530
Comments
I'm not able to reproduce the issue. When I run
it builds and runs fine. I'm using Rust 1.30.0. Does the example I provided above work on your machine? If so, will you please provide more details about the case that is failing for you? |
Very strange! Setting up the project as you have I also don't get any
errors. It appears its related to ndarray being version 11 in my cargo toml.
…On Wed, Nov 7, 2018 at 6:45 AM, Jim Turner ***@***.***> wrote:
I'm not able to reproduce the issue. When I run cargo test in the
ndarray-rand crate, all the tests pass. When I create a project with the
following contents:
-
Cargo.toml
[package]name = "foo"version = "0.1.0"
[dependencies]ndarray = "0.12"ndarray-rand = "0.8"rand = "0.5"
-
src/main.rs
extern crate rand;extern crate ndarray;extern crate ndarray_rand;
use rand::distributions::Range;use ndarray::Array;use ndarray_rand::RandomExt;
fn main() {
assert_eq!(2 + 2, 4);
let (mm, nn) = (5, 5);
for m in 0..mm {
for n in 0..nn {
let a = Array::random((m, n), Range::new(0., 2.));
assert_eq!(a.shape(), &[m, n]);
assert!(a.iter().all(|x| *x <= 2.));
assert!(a.iter().all(|x| *x >= 0.));
}
}
}
it builds and runs fine. I'm using Rust 1.30.0.
Does the example I provided above work on your machine? If so, will you
please provide more details about the case that is failing for you?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#530 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALJWzw8w8X83G4L8V1g-QrchwoYnvrtuks5usuPcgaJpZM4YR0SH>
.
|
Make sure the versions you're using are consistent. For example, |
I see! Sorry that seems like something which could have been avoided.
Thanks for the help!
…On Wed, Nov 7, 2018 at 10:56 AM, Jim Turner ***@***.***> wrote:
Make sure the versions you're using are consistent. For example,
ndarray-rand 0.8 requires ndarray 0.12 and rand 0.5, while ndarray-rand
0.7 requires ndarray 0.11 and rand 0.4. (See the README.
<https://github.com/rust-ndarray/ndarray/tree/master/ndarray-rand>)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#530 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALJWz-OafX3clsKeLKoEhwf5SNy7O0yvks5usx7FgaJpZM4YR0SH>
.
|
You're welcome. It's always nice when the problem is easy to solve. :) |
By the way, this is related to rust-lang/rust#22750. |
The random function from the ndarray_rand::RandomExt trait seems to go unrecognized when following the test example on the repo.
cargo test generates this compilation error
The text was updated successfully, but these errors were encountered: