@@ -13,7 +13,7 @@ fn test_dim()
1313 let ( mm, nn) = ( 5 , 5 ) ;
1414 for m in 0 ..mm {
1515 for n in 0 ..nn {
16- let a = Array :: random ( ( m, n) , Uniform :: new ( 0. , 2. ) ) ;
16+ let a = Array :: random ( ( m, n) , Uniform :: new ( 0. , 2. ) . unwrap ( ) ) ;
1717 assert_eq ! ( a. shape( ) , & [ m, n] ) ;
1818 assert ! ( a. iter( ) . all( |x| * x < 2. ) ) ;
1919 assert ! ( a. iter( ) . all( |x| * x >= 0. ) ) ;
@@ -28,7 +28,7 @@ fn test_dim_f()
2828 let ( mm, nn) = ( 5 , 5 ) ;
2929 for m in 0 ..mm {
3030 for n in 0 ..nn {
31- let a = Array :: random ( ( m, n) . f ( ) , Uniform :: new ( 0. , 2. ) ) ;
31+ let a = Array :: random ( ( m, n) . f ( ) , Uniform :: new ( 0. , 2. ) . unwrap ( ) ) ;
3232 assert_eq ! ( a. shape( ) , & [ m, n] ) ;
3333 assert ! ( a. iter( ) . all( |x| * x < 2. ) ) ;
3434 assert ! ( a. iter( ) . all( |x| * x >= 0. ) ) ;
@@ -41,7 +41,7 @@ fn test_dim_f()
4141fn sample_axis_on_view ( )
4242{
4343 let m = 5 ;
44- let a = Array :: random ( ( m, 4 ) , Uniform :: new ( 0. , 2. ) ) ;
44+ let a = Array :: random ( ( m, 4 ) , Uniform :: new ( 0. , 2. ) . unwrap ( ) ) ;
4545 let _samples = a
4646 . view ( )
4747 . sample_axis ( Axis ( 0 ) , m, SamplingStrategy :: WithoutReplacement ) ;
@@ -52,15 +52,15 @@ fn sample_axis_on_view()
5252fn oversampling_without_replacement_should_panic ( )
5353{
5454 let m = 5 ;
55- let a = Array :: random ( ( m, 4 ) , Uniform :: new ( 0. , 2. ) ) ;
55+ let a = Array :: random ( ( m, 4 ) , Uniform :: new ( 0. , 2. ) . unwrap ( ) ) ;
5656 let _samples = a. sample_axis ( Axis ( 0 ) , m + 1 , SamplingStrategy :: WithoutReplacement ) ;
5757}
5858
5959quickcheck ! {
6060 #[ cfg_attr( miri, ignore) ] // Takes an insufferably long time
6161 fn oversampling_with_replacement_is_fine( m: u8 , n: u8 ) -> TestResult {
6262 let ( m, n) = ( m as usize , n as usize ) ;
63- let a = Array :: random( ( m, n) , Uniform :: new( 0. , 2. ) ) ;
63+ let a = Array :: random( ( m, n) , Uniform :: new( 0. , 2. ) . unwrap ( ) ) ;
6464 // Higher than the length of both axes
6565 let n_samples = m + n + 1 ;
6666
@@ -136,7 +136,7 @@ fn is_subset(a: &Array2<f64>, b: &ArrayView1<f64>, axis: Axis) -> bool
136136fn sampling_without_replacement_from_a_zero_length_axis_should_panic ( )
137137{
138138 let n = 5 ;
139- let a = Array :: random ( ( 0 , n) , Uniform :: new ( 0. , 2. ) ) ;
139+ let a = Array :: random ( ( 0 , n) , Uniform :: new ( 0. , 2. ) . unwrap ( ) ) ;
140140 let _samples = a. sample_axis ( Axis ( 0 ) , 1 , SamplingStrategy :: WithoutReplacement ) ;
141141}
142142
@@ -145,6 +145,6 @@ fn sampling_without_replacement_from_a_zero_length_axis_should_panic()
145145fn sampling_with_replacement_from_a_zero_length_axis_should_panic ( )
146146{
147147 let n = 5 ;
148- let a = Array :: random ( ( 0 , n) , Uniform :: new ( 0. , 2. ) ) ;
148+ let a = Array :: random ( ( 0 , n) , Uniform :: new ( 0. , 2. ) . unwrap ( ) ) ;
149149 let _samples = a. sample_axis ( Axis ( 0 ) , 1 , SamplingStrategy :: WithReplacement ) ;
150150}
0 commit comments