- Add patch numpy-2.1-support.patch, numpy-2.1-interval.patch:
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=52
This commit is contained in:
parent
c6c155c765
commit
b256864458
33
numpy-2.1-interval.patch
Normal file
33
numpy-2.1-interval.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From 6b61e8a6b3dddab13b88e51309cbdf2f28247960 Mon Sep 17 00:00:00 2001
|
||||
From: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
|
||||
Date: Thu, 22 Aug 2024 08:20:25 +0200
|
||||
Subject: [PATCH] Fix docstring and implementation of Interval.power
|
||||
|
||||
This makes the code more resilient to future numpy changes.
|
||||
---
|
||||
pythran/interval.py | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/pythran/interval.py b/pythran/interval.py
|
||||
index 4e5dff8fd..b8ef42e69 100644
|
||||
--- a/pythran/interval.py
|
||||
+++ b/pythran/interval.py
|
||||
@@ -196,13 +196,15 @@ def __pow__(range1, range2):
|
||||
>>> Interval(1, 5) ** Interval(-5, -4)
|
||||
Interval(low=1.0, high=1.0)
|
||||
>>> Interval(-1, 5) ** Interval(-5, 3)
|
||||
- Interval(low=-1.0, high=125.0)
|
||||
+ Interval(low=-1.0, high=125)
|
||||
>>> Interval(1, 5) ** Interval(3, 8)
|
||||
- Interval(low=1.0, high=390625.0)
|
||||
+ Interval(low=1, high=390625)
|
||||
"""
|
||||
res = [v1 ** v2 for v1, v2 in
|
||||
itertools.product(range1.bounds(), range2.bounds())]
|
||||
- return Interval(numpy.ceil(min(res)), numpy.floor(max(res)))
|
||||
+ minres, maxres = min(res), max(res)
|
||||
+ return Interval(type(minres)(numpy.ceil(minres)),
|
||||
+ type(maxres)(numpy.floor(maxres)))
|
||||
|
||||
def __lshift__(range1, range2):
|
||||
"""
|
@ -1,7 +1,7 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Sep 1 13:28:40 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- Add patch numpy-2.1-support.patch:
|
||||
- Add patch numpy-2.1-support.patch, numpy-2.1-interval.patch:
|
||||
* Fix test suite failure with numpy 2.1
|
||||
- prepare for python 3.13
|
||||
|
||||
|
@ -58,6 +58,7 @@ Source99: python-pythran-rpmlintrc
|
||||
# PATCH-FIX-UPSTREAM gh#serge-sans-paille/pythran#840a0e706ec39963aec6bcd1f118bf33177c20b4
|
||||
Patch0: support-gast-0.6.patch
|
||||
Patch1: https://github.com/serge-sans-paille/pythran/pull/2231/commits/9261d30aa9618cb2a5a698d39752263b076f2d4b.patch#/numpy-2.1-support.patch
|
||||
Patch2: https://github.com/serge-sans-paille/pythran/commit/6b61e8a6b3dddab13b88e51309cbdf2f28247960.patch#/numpy-2.1-interval.patch
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
|
Loading…
Reference in New Issue
Block a user