user [email protected]
usertags 1136867 python3.15
tags 1136867 patch
thanks
Hi!
While rebuilding the python related packages against the Python 3.15rc2
version I ran into this FTBFS [1].
This issue was fixed in upstream's PR #438, although 3 of the 6 commits
are just about GH workflows. Applying the other 3 makes the Debian
package build again.
I've applied these fixes in the sandbox [3] to verify that it builds
successfully, these should be applied in Debian to get the package back
to a healthy state.
Happy hacking,
[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4645848/
[2]: https://github.com/pypr/pysph/pull/438
[3]: https://debusine.debian.net/debian/r-python-python3.15/
--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
From 2918cb567ec7e699a531ce0932c0c460df429c95 Mon Sep 17 00:00:00 2001
From: navaneet <navaneet@acni>
Date: Mon, 17 Aug 2026 21:46:52 +0530
Subject: [PATCH] test(parallel summation_density): fix dtype
mpi4py expects `gathers` as an int array so specified it as an an int
explicitly.
---
pysph/parallel/tests/summation_density.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pysph/parallel/tests/summation_density.py b/pysph/parallel/tests/summation_density.py
index 58decfef2..a0426fc74 100644
--- a/pysph/parallel/tests/summation_density.py
+++ b/pysph/parallel/tests/summation_density.py
@@ -104,7 +104,7 @@ def main():
H1 = numpy.ones_like(X1) * hdx * dx
RHO1 = numpy.zeros_like(X1)
- gathers = (numpy.ones(size) * numMyPoints, None)
+ gathers = (numpy.ones(size, dtype=int) * numMyPoints, None)
comm.Gatherv(sendbuf=[x1, mpi.DOUBLE], recvbuf=[X1, gathers, mpi.DOUBLE])
comm.Gatherv(sendbuf=[y1, mpi.DOUBLE], recvbuf=[Y1, gathers, mpi.DOUBLE])
From 42ac0a10572bfddab2dbbd64c9c5f4b01db139db Mon Sep 17 00:00:00 2001
From: navaneet <navaneet@acni>
Date: Mon, 17 Aug 2026 23:49:00 +0530
Subject: [PATCH] fix: more implicit types issues with numpy 2.0
explicitly using .item(), or index with [0] before passing to int() or
Cython C-type casts (unsigned int, unsigned long long)
---
pysph/base/device_helper.py | 4 ++--
pysph/base/stratified_sfc_gpu_nnps.pyx | 2 +-
pysph/base/z_order_gpu_nnps.pyx | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/pysph/base/device_helper.py b/pysph/base/device_helper.py
index e30af81b7..b5882dd9f 100644
--- a/pysph/base/device_helper.py
+++ b/pysph/base/device_helper.py
@@ -319,7 +319,7 @@ def align_particles(self):
self.align(indices)
- self.num_real_particles = int(num_real_particles.get())
+ self.num_real_particles = int(num_real_particles.get()[0])
def _build_indices_with_strides(self, tag_arr, stride):
num_particles = len(tag_arr.dev)
@@ -387,7 +387,7 @@ def _remove_particles_bool(self, if_remove, align=True):
num_removed_particles=num_removed_particles,
num_particles=num_particles)
- new_num_particles = num_particles - int(num_removed_particles.get())
+ new_num_particles = num_particles - int(num_removed_particles.get()[0])
strides = set(self._particle_array.stride.values())
s_indices = {1: new_indices}
diff --git a/pysph/base/stratified_sfc_gpu_nnps.pyx b/pysph/base/stratified_sfc_gpu_nnps.pyx
index 022b76667..ce360c494 100644
--- a/pysph/base/stratified_sfc_gpu_nnps.pyx
+++ b/pysph/base/stratified_sfc_gpu_nnps.pyx
@@ -130,7 +130,7 @@ cdef class StratifiedSFCGPUNNPS(GPUNNPS):
self.pid_keys[pa_index].set_data(sorted_keys)
#FIXME: This will only work on OpenCL and CUDA backends
- cdef unsigned long long key = <unsigned long long> (sorted_keys[0].get())
+ cdef unsigned long long key = <unsigned long long> (sorted_keys[0].get().item())
self.start_idx_levels[pa_index][key >> self.max_num_bits] = 0
diff --git a/pysph/base/z_order_gpu_nnps.pyx b/pysph/base/z_order_gpu_nnps.pyx
index 5076729bf..b0e3133f9 100644
--- a/pysph/base/z_order_gpu_nnps.pyx
+++ b/pysph/base/z_order_gpu_nnps.pyx
@@ -224,7 +224,7 @@ cdef class ZOrderGPUNNPS(GPUNNPS):
self.pid_keys[src_index], self.cids[src_index],
self.src.get_number_of_particles(), self.max_cid_src)
- overflow_size = <unsigned int>(self.max_cid_src.get()) - \
+ overflow_size = <unsigned int>(self.max_cid_src.get()[0]) - \
self.max_cid[src_index]
self.overflow_cid_to_idx.resize(max(1, 27 * overflow_size))
From 6e8e1cb520dbda0d688ebc04ab96d21536903e3a Mon Sep 17 00:00:00 2001
From: navaneet <navaneet@acni>
Date: Mon, 17 Aug 2026 21:09:56 +0530
Subject: [PATCH] fix(solid_mech.rings): indexing constants properly
Numpy>=2.0 no longer implicitly converts 1-D arrays to Python scalars for %-formatting, raising a TypeError. This is fixed. This was possibly an effect of [NEP 50](https://numpy.org/neps/nep-0050-scalar-promotion.html)
---
pysph/examples/solid_mech/rings.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pysph/examples/solid_mech/rings.py b/pysph/examples/solid_mech/rings.py
index 035bb7a2d..488eece9a 100644
--- a/pysph/examples/solid_mech/rings.py
+++ b/pysph/examples/solid_mech/rings.py
@@ -70,7 +70,7 @@ def create_particles(self):
print('Ellastic Collision with %d particles' % (x.size))
print("Shear modulus G = %g, Young's modulus = %g, Poisson's ratio =%g"
- % (pa.G, pa.E, pa.nu))
+ % (pa.G[0], pa.E[0], pa.nu[0]))
u_f = 0.059
pa.u = pa.cs * u_f * (2 * (x < 0) - 1)