Skip to content

Commit 9a55737

Browse files
committed
bump ndarray to 0.17.1 and its family
1 parent acfde96 commit 9a55737

File tree

5 files changed

+26
-23
lines changed

5 files changed

+26
-23
lines changed

Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ version = "0.1.0"
2626
approx = "0.5.1"
2727
atomic_float = "1.1.0"
2828
itertools = "0.14.0"
29-
ndarray = "0.16.1"
29+
ndarray = "0.17.1"
3030
num-traits = "0.2.19"
3131
parking_lot = "0.12.5"
3232
serde = { version = "1", features = ["derive"] }

src-tauri/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ identity-hash = "0.1.0"
3131
itertools = { workspace = true }
3232
log = "0.4"
3333
ndarray = { workspace = true, features = ["approx", "blas", "rayon"] }
34-
ndarray-stats = "0.6.0"
34+
ndarray-stats = "0.7.0"
3535
num-traits = { workspace = true }
3636
num_cpus = "1.17.0"
3737
parking_lot = { workspace = true }
@@ -97,4 +97,4 @@ tauri-plugin-window-state = "2"
9797
[dev-dependencies]
9898
approx = { workspace = true }
9999
hound = "3.5.1"
100-
ndarray-rand = "0.15.0"
100+
ndarray-rand = "0.16.0"

src-tauri/src/core/dynamics/envelope.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -509,17 +509,20 @@ where
509509
mod tests {
510510
use super::*;
511511
use approx::assert_abs_diff_eq;
512-
use ndarray_rand::{RandomExt, rand::prelude::*, rand_distr::Uniform};
512+
use ndarray_rand::rand::prelude::*;
513+
use ndarray_rand::rand_distr::Uniform;
514+
use ndarray_rand::{RandomExt, rand};
513515

514516
#[test]
515517
fn box_sum_works() {
516518
let length = 1000;
517519
let max_box_len = 100;
518-
let mut rng = thread_rng();
519-
let signal = Array1::random_using(length, Uniform::new_inclusive(-1., 1.), &mut rng);
520+
let mut rng = rand::rng();
521+
let signal =
522+
Array1::random_using(length, Uniform::new_inclusive(-1., 1.).unwrap(), &mut rng);
520523
let mut box_sum = BoxSum::new(max_box_len);
521524
let mut box_filter = BoxFilter::new(max_box_len);
522-
let rng_box_len = Uniform::new_inclusive(1, max_box_len);
525+
let rng_box_len = Uniform::new_inclusive(1, max_box_len).unwrap();
523526

524527
for i in 0..length {
525528
let box_len = rng_box_len.sample(&mut rng);
@@ -552,10 +555,10 @@ mod tests {
552555
#[test]
553556
fn box_sum_drift_works() {
554557
let max_box_len = 100;
555-
let mut rng = thread_rng();
558+
let mut rng = rand::rng();
556559
let mut box_sum = BoxSum::new(max_box_len);
557560

558-
let rng_x = Uniform::new_inclusive(1e6, 2e6);
561+
let rng_x = Uniform::new_inclusive(1e6, 2e6).unwrap();
559562
for _ in 0..10 {
560563
for _ in 0..10000 {
561564
box_sum.write(rng_x.sample(&mut rng));
@@ -566,7 +569,7 @@ mod tests {
566569
box_sum.write(x);
567570
}
568571

569-
let rng_box_len = Uniform::new_inclusive(25, 100);
572+
let rng_box_len = Uniform::new_inclusive(25, 100).unwrap();
570573
for _ in 0..10 {
571574
let box_len = rng_box_len.sample(&mut rng);
572575
let expected = if box_len % 2 == 1 { 1. } else { 0. };
@@ -598,8 +601,8 @@ mod tests {
598601
let mut stack = BoxStackFilter::<f32>::with_num_layers(50, 1);
599602
let ratios = arr1(&[6., 3., 1.]);
600603
stack.resize(101, ratios);
601-
let mut rng = thread_rng();
602-
let rng_x = Uniform::new_inclusive(-1., 1.);
604+
let mut rng = rand::rng();
605+
let rng_x = Uniform::new_inclusive(-1., 1.).unwrap();
603606

604607
for _ in 0..1000 {
605608
let x = rng_x.sample(&mut rng);

src-tauri/src/core/simd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ mod tests {
921921

922922
// A simple pseudo-random number generator for test data
923923
fn generate_random_data(size: usize) -> Vec<f32> {
924-
let arr = Array1::random(size, Uniform::new(-100.0, 100.0));
924+
let arr = Array1::random(size, Uniform::new(-100.0, 100.0).unwrap());
925925
let (vec, _) = arr.into_raw_vec_and_offset();
926926
vec
927927
}

0 commit comments

Comments
 (0)