From fc9077d19b41ac4a4cfb2d031348919b87797e0cafd9c39833f3b0b8b9134afa Mon Sep 17 00:00:00 2001 From: Dmitry Roshchin Date: Mon, 16 Sep 2024 06:15:52 +0000 Subject: [PATCH] Accepting request 1201248 from home:badshah400:branches:science Add python-PyCBC-tests-numpy-2.0-compat.patch for compatibility with numpy >= 2.0 in tests. OBS-URL: https://build.opensuse.org/request/show/1201248 OBS-URL: https://build.opensuse.org/package/show/science/python-PyCBC?expand=0&rev=40 --- python-PyCBC-tests-numpy-2.0-compat.patch | 18 ++++++++++++++++++ python-PyCBC.changes | 6 ++++++ python-PyCBC.spec | 2 ++ 3 files changed, 26 insertions(+) create mode 100644 python-PyCBC-tests-numpy-2.0-compat.patch diff --git a/python-PyCBC-tests-numpy-2.0-compat.patch b/python-PyCBC-tests-numpy-2.0-compat.patch new file mode 100644 index 0000000..a9e333c --- /dev/null +++ b/python-PyCBC-tests-numpy-2.0-compat.patch @@ -0,0 +1,18 @@ +--- + pycbc/conversions.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: pycbc-2.5.1/pycbc/conversions.py +=================================================================== +--- pycbc-2.5.1.orig/pycbc/conversions.py ++++ pycbc-2.5.1/pycbc/conversions.py +@@ -77,7 +77,8 @@ def ensurearray(*args): + inputs was an array. + """ + input_is_array = any(isinstance(arg, numpy.ndarray) for arg in args) +- args = numpy.broadcast_arrays(*args) ++ # For numpy >= 2, broadcast_arrays returns tuple instead of list ++ args = list(numpy.broadcast_arrays(*args)) + args.append(input_is_array) + return args + diff --git a/python-PyCBC.changes b/python-PyCBC.changes index e039471..f5f7ecf 100644 --- a/python-PyCBC.changes +++ b/python-PyCBC.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Sep 15 14:03:59 UTC 2024 - Atri Bhattacharya + +- Add python-PyCBC-tests-numpy-2.0-compat.patch for compatibility + with numpy >= 2.0 in tests. + ------------------------------------------------------------------- Sat Aug 17 05:29:48 UTC 2024 - Atri Bhattacharya diff --git a/python-PyCBC.spec b/python-PyCBC.spec index 61383f5..4671f07 100644 --- a/python-PyCBC.spec +++ b/python-PyCBC.spec @@ -36,6 +36,8 @@ Summary: Core library to analyze gravitational-wave data License: GPL-3.0-or-later URL: http://www.pycbc.org/ Source0: https://github.com/gwastro/pycbc/archive/v%{version}.tar.gz#/%{modname}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM python-PyCBC-tests-numpy-2.0-compat.patch badshah400@gmail.com -- Fix appending to numpy.broadcast_arrays output for numpy >= 2.0 +Patch1: python-PyCBC-tests-numpy-2.0-compat.patch BuildRequires: %{python_module Cython >= 0.29} BuildRequires: %{python_module devel >= 3.9} BuildRequires: %{python_module numpy-devel >= 1.16.0}