From ba3de614e9d8dd34b4a97e9837429d6e4ec87ec0 Mon Sep 17 00:00:00 2001 From: Dan Foreman-Mackey Date: Thu, 3 Oct 2024 12:27:03 -0400 Subject: [PATCH] Switch to integer data type in Eigen test for default arguments. The `test10_eigen_scalar_default` test in `test_eigen.py` relies unnecessarily on exact equality of floating point numbers. In my environment, with a recent commit of Eigen, the addition in the test is causing the equality check to fail. There might be other upstream issues to consider here, but the specific test failure here seems to be a false positive! This PR switches that test to use integer zeros to be less sensitive to numerics. Let me know what you think - thanks! --- tests/test_eigen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_eigen.cpp b/tests/test_eigen.cpp index 8e555546..ee3ba346 100644 --- a/tests/test_eigen.cpp +++ b/tests/test_eigen.cpp @@ -169,7 +169,7 @@ NB_MODULE(test_eigen_ext, m) { m.def("sparse_complex", []() -> Eigen::SparseMatrix> { return {}; }); /// issue #166 - using Matrix1d = Eigen::Matrix; + using Matrix1d = Eigen::Matrix; try { m.def( "default_arg", [](Matrix1d a, Matrix1d b) { return a + b; },