Skip to content

Commit

Permalink
Add information about the reason to still include tests in argmin-mat…
Browse files Browse the repository at this point in the history
…hs ndarray src even though separate crates are used for testing with the ndarray-linalg backend
  • Loading branch information
Tastaturtaste committed Jan 3, 2024
1 parent 4c8d905 commit 2633198
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion argmin-math/ndarray-linalg-tests/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
This folder contains tests for the argmin-math crate.
Separate projects are needed to test against multiple versions of dependencies because of the required additivity of features even when they are not active and because only one crate can specify a `links` flag in a given dependency graph. This is mainly necessary for the backend dependency of ndarray-linalg.
Separate projects are needed to test against multiple versions of dependencies because of the required additivity of features, which is not possible for multiple separate versions of dependencies when they specify the `links` attribute with the same name but different versions. This additivity with regard to the `links` attribute is necessary even when all but one of the concerned dependencies are disabled behind a feature. This is necessary for the backend dependency of ndarray-linalg.
Read more here: https://github.com/argmin-rs/argmin/issues/368#issue-1929115127
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ make_add!(f64);
make_add!(Complex<f32>);
make_add!(Complex<f64>);

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/conj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ make_conj!(Complex<i64>);
make_conj!(Complex<f32>);
make_conj!(Complex<f64>);

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/div.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ make_div!(f64);
make_div!(Complex<f32>);
make_div!(Complex<f64>);

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/dot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ make_dot_ndarray!(usize);
make_dot_ndarray!(f32);
make_dot_ndarray!(f64);

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/eye.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ make_eye!(u64);
make_eye!(f32);
make_eye!(f64);

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/inv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ make_inv!(f64);
make_inv!(Complex<f32>);
make_inv!(Complex<f64>);

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/l1norm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ make_l1norm_complex!(Complex<usize>, usize);
make_l1norm_complex!(Complex<f32>, f32);
make_l1norm_complex!(Complex<f64>, f64);

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/l2norm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ make_norm_complex!(Complex<usize>, usize);
make_norm_complex!(Complex<f32>, f32);
make_norm_complex!(Complex<f64>, f64);

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/minmax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ make_minmax!(u64);
make_minmax!(f32);
make_minmax!(f64);

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/mul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ make_complex_integer_mul!(u64);
make_complex_integer_mul!(isize);
make_complex_integer_mul!(usize);

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ make_random!(u64);
make_random!(f32);
make_random!(f64);

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/scaledadd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/scaledsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/signum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ make_signum_complex!(Complex<i64>);
make_signum_complex!(Complex<f32>);
make_signum_complex!(Complex<f64>);

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ make_sub!(f64);
make_sub!(Complex<f32>);
make_sub!(Complex<f64>);

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/transpose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ make_add!(f64);
make_add!(Complex<f32>);
make_add!(Complex<f64>);

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down
2 changes: 2 additions & 0 deletions argmin-math/src/ndarray_m/zero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ where
// }
}

// All code that does not depend on a linked ndarray-linalg backend can still be tested as normal.
// To avoid dublicating tests and to allow convenient testing of functionality that does not need ndarray-linalg the tests are still included here.
// The tests expect the name for the crate containing the tested functions to be argmin_math
#[cfg(test)]
use crate as argmin_math;
Expand Down

0 comments on commit 2633198

Please sign in to comment.