forked from pool/python-pythran
- Update to 0.14.0:
* Numpy compatibility - update signatures, complex number handling, long double support * Lazyly import top-level modules and submodules * Improve array indexing by an array * Require at least clang 7 or gcc 8 * Make pythran compilation reproducible * Support np.roll with multiple axis * Support numpy.ndarray.view * Improve list resizing speed * Fix bug when filtering an empty sequence - Drop patches, now included upstream: * numpy-longdouble.patch * numpy-complex.patch - Switch to pyproject macros. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pythran?expand=0&rev=30
This commit is contained in:
parent
99ff7f3e99
commit
b876032470
@ -1,39 +0,0 @@
|
|||||||
From a49dc44076f7068205c22f532975c50cc4c03958 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Lysandros Nikolaou <lisandrosnik@gmail.com>
|
|
||||||
Date: Wed, 19 Jul 2023 13:03:41 +0200
|
|
||||||
Subject: [PATCH] Use npy_creal/npy_cimag from npy_math in from_python::convert
|
|
||||||
|
|
||||||
---
|
|
||||||
pythran/pythonic/types/complex.hpp | 5 +++--
|
|
||||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/pythran/pythonic/types/complex.hpp b/pythran/pythonic/types/complex.hpp
|
|
||||||
index 9b57f7384..929a3d200 100644
|
|
||||||
--- a/pythran/pythonic/types/complex.hpp
|
|
||||||
+++ b/pythran/pythonic/types/complex.hpp
|
|
||||||
@@ -177,6 +177,7 @@ PYTHONIC_NS_END
|
|
||||||
#ifdef ENABLE_PYTHON_MODULE
|
|
||||||
|
|
||||||
#include "numpy/arrayscalars.h"
|
|
||||||
+#include "numpy/npy_math.h"
|
|
||||||
#include "pythonic/python/core.hpp"
|
|
||||||
|
|
||||||
PYTHONIC_NS_BEGIN
|
|
||||||
@@ -228,7 +229,7 @@ inline std::complex<long double>
|
|
||||||
from_python<std::complex<long double>>::convert(PyObject *obj)
|
|
||||||
{
|
|
||||||
auto val = PyArrayScalar_VAL(obj, CLongDouble);
|
|
||||||
- return {val.real, val.imag};
|
|
||||||
+ return {npy_creall(val), npy_cimagl(val)};
|
|
||||||
}
|
|
||||||
|
|
||||||
template <>
|
|
||||||
@@ -243,7 +244,7 @@ inline std::complex<float>
|
|
||||||
from_python<std::complex<float>>::convert(PyObject *obj)
|
|
||||||
{
|
|
||||||
auto val = PyArrayScalar_VAL(obj, CFloat);
|
|
||||||
- return {val.real, val.imag};
|
|
||||||
+ return {npy_crealf(val), npy_cimagf(val)};
|
|
||||||
}
|
|
||||||
PYTHONIC_NS_END
|
|
||||||
#endif
|
|
@ -1,122 +0,0 @@
|
|||||||
From 339fb5dcdf28f40311b5051925fd8a2c86286ac6 Mon Sep 17 00:00:00 2001
|
|
||||||
From: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
|
|
||||||
Date: Thu, 6 Jul 2023 22:06:20 +0200
|
|
||||||
Subject: [PATCH] Introduce pythran/pythonic/include/types/longdouble.hpp et
|
|
||||||
cie
|
|
||||||
|
|
||||||
New numpy version alias np.float128 to np.longdouble, so we need these
|
|
||||||
headers too. Same for np.complex256 and np.clongdouble.
|
|
||||||
|
|
||||||
SLightly adjust notebook tests for portability to that respect.
|
|
||||||
---
|
|
||||||
pythran/pythonic/include/types/clongdouble.hpp | 6 ++++++
|
|
||||||
pythran/pythonic/include/types/longdouble.hpp | 4 ++++
|
|
||||||
pythran/pythonic/types/clongdouble.hpp | 7 +++++++
|
|
||||||
pythran/pythonic/types/float128.hpp | 2 +-
|
|
||||||
pythran/pythonic/types/longdouble.hpp | 6 ++++++
|
|
||||||
pythran/tests/notebooks/export.ipynb | 14 +++++++-------
|
|
||||||
6 files changed, 31 insertions(+), 8 deletions(-)
|
|
||||||
create mode 100644 pythran/pythonic/include/types/clongdouble.hpp
|
|
||||||
create mode 100644 pythran/pythonic/include/types/longdouble.hpp
|
|
||||||
create mode 100644 pythran/pythonic/types/clongdouble.hpp
|
|
||||||
create mode 100644 pythran/pythonic/types/longdouble.hpp
|
|
||||||
|
|
||||||
diff --git a/pythran/pythonic/include/types/clongdouble.hpp b/pythran/pythonic/include/types/clongdouble.hpp
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..dd666a52f5
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/pythran/pythonic/include/types/clongdouble.hpp
|
|
||||||
@@ -0,0 +1,6 @@
|
|
||||||
+#ifndef PYTHONIC_INCLUDE_TYPES_CLONGDOUBLE_HPP
|
|
||||||
+#define PYTHONIC_INCLUDE_TYPES_CLONGDOUBLE_HPP
|
|
||||||
+
|
|
||||||
+#include "pythonic/include/types/complex.hpp"
|
|
||||||
+
|
|
||||||
+#endif
|
|
||||||
diff --git a/pythran/pythonic/include/types/longdouble.hpp b/pythran/pythonic/include/types/longdouble.hpp
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..1ee2fca96c
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/pythran/pythonic/include/types/longdouble.hpp
|
|
||||||
@@ -0,0 +1,4 @@
|
|
||||||
+#ifndef PYTHONIC_INCLUDE_TYPES_LONGDOUBLE_HPP
|
|
||||||
+#define PYTHONIC_INCLUDE_TYPES_LONGDOUBLE_HPP
|
|
||||||
+
|
|
||||||
+#endif
|
|
||||||
diff --git a/pythran/pythonic/types/clongdouble.hpp b/pythran/pythonic/types/clongdouble.hpp
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..057a2b9cb6
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/pythran/pythonic/types/clongdouble.hpp
|
|
||||||
@@ -0,0 +1,7 @@
|
|
||||||
+#ifndef PYTHONIC_TYPES_CLONGDOUBLE_HPP
|
|
||||||
+#define PYTHONIC_TYPES_CLONGDOUBLE_HPP
|
|
||||||
+
|
|
||||||
+#include "pythonic/include/types/clongdouble.hpp"
|
|
||||||
+#include "pythonic/types/complex.hpp"
|
|
||||||
+
|
|
||||||
+#endif
|
|
||||||
diff --git a/pythran/pythonic/types/float128.hpp b/pythran/pythonic/types/float128.hpp
|
|
||||||
index bf67552447..0943827ff3 100644
|
|
||||||
--- a/pythran/pythonic/types/float128.hpp
|
|
||||||
+++ b/pythran/pythonic/types/float128.hpp
|
|
||||||
@@ -1,6 +1,6 @@
|
|
||||||
#ifndef PYTHONIC_TYPES_FLOAT128_HPP
|
|
||||||
#define PYTHONIC_TYPES_FLOAT128_HPP
|
|
||||||
|
|
||||||
-#include "pythonic/include/types/float64.hpp"
|
|
||||||
+#include "pythonic/include/types/float128.hpp"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
diff --git a/pythran/pythonic/types/longdouble.hpp b/pythran/pythonic/types/longdouble.hpp
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000..b3944cea6a
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/pythran/pythonic/types/longdouble.hpp
|
|
||||||
@@ -0,0 +1,6 @@
|
|
||||||
+#ifndef PYTHONIC_TYPES_LONGDOUBLE_HPP
|
|
||||||
+#define PYTHONIC_TYPES_LONGDOUBLE_HPP
|
|
||||||
+
|
|
||||||
+#include "pythonic/include/types/longdouble.hpp"
|
|
||||||
+
|
|
||||||
+#endif
|
|
||||||
diff --git a/pythran/tests/notebooks/export.ipynb b/pythran/tests/notebooks/export.ipynb
|
|
||||||
index aa2baadc06..3f390dc0f1 100644
|
|
||||||
--- a/pythran/tests/notebooks/export.ipynb
|
|
||||||
+++ b/pythran/tests/notebooks/export.ipynb
|
|
||||||
@@ -418,20 +418,20 @@
|
|
||||||
"name": "stdout",
|
|
||||||
"output_type": "stream",
|
|
||||||
"text": [
|
|
||||||
- "(1.5, -1.5) <class 'numpy.float32'>\n",
|
|
||||||
- "(1.5, -1.5) <class 'float'>\n",
|
|
||||||
- "(1.5, -1.5) <class 'numpy.float128'>\n"
|
|
||||||
+ "(1.5, -1.5)\n",
|
|
||||||
+ "(1.5, -1.5)\n",
|
|
||||||
+ "(1.5, -1.5)\n"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": [
|
|
||||||
"import numpy as np\n",
|
|
||||||
"x64 = dtype(np.complex64(1.5 + -1.5j))\n",
|
|
||||||
- "print(x64, type(x64[0]))\n",
|
|
||||||
+ "print(x64)\n",
|
|
||||||
"x128 = dtype(np.complex128(1.5 + -1.5j))\n",
|
|
||||||
- "print(x128, type(x128[0]))\n",
|
|
||||||
+ "print(x128)\n",
|
|
||||||
"x256 = dtype(np.complex256(1.5 + -1.5j))\n",
|
|
||||||
- "print(x256, type(x256[0]))"
|
|
||||||
+ "print(x256)"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
@@ -969,7 +969,7 @@
|
|
||||||
"name": "python",
|
|
||||||
"nbconvert_exporter": "python",
|
|
||||||
"pygments_lexer": "ipython3",
|
|
||||||
- "version": "3.10.9"
|
|
||||||
+ "version": "3.10.11"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nbformat": 4,
|
|
@ -1,3 +1,22 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Nov 21 06:35:39 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Update to 0.14.0:
|
||||||
|
* Numpy compatibility - update signatures, complex number handling, long
|
||||||
|
double support
|
||||||
|
* Lazyly import top-level modules and submodules
|
||||||
|
* Improve array indexing by an array
|
||||||
|
* Require at least clang 7 or gcc 8
|
||||||
|
* Make pythran compilation reproducible
|
||||||
|
* Support np.roll with multiple axis
|
||||||
|
* Support numpy.ndarray.view
|
||||||
|
* Improve list resizing speed
|
||||||
|
* Fix bug when filtering an empty sequence
|
||||||
|
- Drop patches, now included upstream:
|
||||||
|
* numpy-longdouble.patch
|
||||||
|
* numpy-complex.patch
|
||||||
|
- Switch to pyproject macros.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Aug 8 16:00:58 UTC 2023 - ecsos <ecsos@opensuse.org>
|
Tue Aug 8 16:00:58 UTC 2023 - ecsos <ecsos@opensuse.org>
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ ExclusiveArch: x86_64
|
|||||||
%endif
|
%endif
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-pythran%{psuffix}
|
Name: python-pythran%{psuffix}
|
||||||
Version: 0.13.1
|
Version: 0.14.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Ahead of Time compiler for numeric kernels
|
Summary: Ahead of Time compiler for numeric kernels
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
@ -52,11 +52,9 @@ URL: https://github.com/serge-sans-paille/pythran
|
|||||||
# Tests are only availble in github archive
|
# Tests are only availble in github archive
|
||||||
Source0: https://github.com/serge-sans-paille/pythran/archive/refs/tags/%{version}.tar.gz#/pythran-%{version}-gh.tar.gz
|
Source0: https://github.com/serge-sans-paille/pythran/archive/refs/tags/%{version}.tar.gz#/pythran-%{version}-gh.tar.gz
|
||||||
Source99: python-pythran-rpmlintrc
|
Source99: python-pythran-rpmlintrc
|
||||||
#PATCH-FIX-UPSTREAM https://github.com/serge-sans-paille/pythran/commit/339fb5dcdf28f40311b5051925fd8a2c86286ac6 Introduce pythran/pythonic/include/types/longdouble.hpp et cie
|
BuildRequires: %{python_module pip}
|
||||||
Patch: numpy-longdouble.patch
|
|
||||||
#PATCH-FIX-UPSTREAM https://github.com/serge-sans-paille/pythran/commit/a49dc44076f7068205c22f532975c50cc4c03958 Use npy_creal/npy_cimag from npy_math in from_python::convert
|
|
||||||
Patch1: numpy-complex.patch
|
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-beniget >= 0.4.0
|
Requires: python-beniget >= 0.4.0
|
||||||
@ -115,11 +113,11 @@ EOF
|
|||||||
sed -i -e 's/-O0/-O1/g' -e 's/-Werror/-w/g' pythran/tests/__init__.py
|
sed -i -e 's/-O0/-O1/g' -e 's/-Werror/-w/g' pythran/tests/__init__.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%pyproject_wheel
|
||||||
|
|
||||||
%if !%{with test}
|
%if !%{with test}
|
||||||
%install
|
%install
|
||||||
%python_install
|
%pyproject_install
|
||||||
%python_clone -a %{buildroot}%{_bindir}/pythran
|
%python_clone -a %{buildroot}%{_bindir}/pythran
|
||||||
%python_clone -a %{buildroot}%{_bindir}/pythran-config
|
%python_clone -a %{buildroot}%{_bindir}/pythran-config
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
@ -149,7 +147,7 @@ donttest="$donttest or test_toolchain or test_cli"
|
|||||||
%python_alternative %{_bindir}/pythran-config
|
%python_alternative %{_bindir}/pythran-config
|
||||||
%{python_sitelib}/pythran
|
%{python_sitelib}/pythran
|
||||||
%{python_sitelib}/omp
|
%{python_sitelib}/omp
|
||||||
%{python_sitelib}/pythran-%{version}*-info
|
%{python_sitelib}/pythran-%{version}.dist-info
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
BIN
pythran-0.13.1-gh.tar.gz
(Stored with Git LFS)
BIN
pythran-0.13.1-gh.tar.gz
(Stored with Git LFS)
Binary file not shown.
3
pythran-0.14.0-gh.tar.gz
Normal file
3
pythran-0.14.0-gh.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:c476c50bc7b27c06805c479720f807205e0000585d5e195e11f99cf6af9abf5b
|
||||||
|
size 3642431
|
Loading…
Reference in New Issue
Block a user