#1141074 siconos: test_bouncing_ball fails with ValueError: setting an array element with a sequence

#1141074#5
Date:
2026-06-29 10:16:24 UTC
From:
To:
Dear Maintainer,

I've encountered an issue while building `siconos` locally. The `siconos.kernel` test suite fails during `test_bouncing_ball.py` with a `ValueError: setting an array element with a sequence.`

This is caused by stricter dimensionality enforcement in NumPy 2.4. It no longer permits implicitly converting 1-dimensional arrays or sequences into Python scalars when assigning to a specific coordinate in a pre-allocated array. The value must be explicitly extracted as a scalar by appending `[0]`.

Relevant Traceback snippet:
----------------------------------------------------------------------
test_bouncing_ball.py::test_bouncing_ball2 FAILED                        [ 50%]
test_bouncing_ball.py::test_bouncing_ball3 FAILED                        [ 75%]
test_bouncing_ball.py::test_bouncing_ball4 FAILED                        [100%]

=================================== FAILURES ===================================
test_bouncing_ball.py:240: ValueError
----------------------------------------------------------------------

Upstream context:
There is no need to forward this upstream. Upstream is currently working on major architectural changes (currently on rc1) that remove or significantly alter the directories associated with this bug.

However, since those upstream changes will take time to finalize and land, a simple interim patch indexing the array with `[0]` is necessary for Debian to restore the build and pass the tests.

This patch has been merged into Ubuntu.
--- a/kernel/swig/tests/test_bouncing_ball.py
+++ b/kernel/swig/tests/test_bouncing_ball.py
@@ -237,13 +237,13 @@
     data[0, 1] = ball.q()[0]
     data[0, 2] = ball.velocity()[0]
     data[0, 3] = ball.p(1)[0]
-    data[0, 4] = inter.lambda_(1)
+    data[0, 4] = inter.lambda_(1)[0]

     data_d[0, 0] = t0
     data_d[0, 1] = ball_d.q()[0]
     data_d[0, 2] = ball_d.velocity()[0]
     data_d[0, 3] = ball_d.p(1)[0]
-    data_d[0, 4] = inter_d.lambda_(1)
+    data_d[0, 4] = inter_d.lambda_(1)[0]

     k = 1

Thanks,
vmpyr

#1141074#10
Date:
2026-06-29 10:23:04 UTC
From:
To:
Hindsight, seems to be a duplicate of:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1136873

#1141074#15
Date:
2026-06-29 10:27:31 UTC
From:
To:
Closing this bug report as it is a duplicate.

I recently submitted this issue, but I have since realized that it is
already being tracked under another active bug report (Bug #1136873).

To prevent fragmented discussions and keep the BTS clean, I am closing this
duplicate. All relevant logs and patches have been noted in the primary bug
report.

Thanks,
vmpyr

On Mon, 29 Jun 2026 at 15:53, Ujjwal Sarswat <ujjwal.sarswat@canonical.com> wrote: