1 Star 0 Fork 33

shafeipaozi/scipy

forked from src-openEuler/scipy 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-Mark-function-pointer-ctypedefs-as-noexcept.patch 2.53 KB
一键复制 编辑 原始数据 按行查看 历史
SuperSix173 提交于 2024-02-04 11:31 . Fix scipy compile error in cython3
From 50d0825256ddb76c5567e6cc8eb50e7d36908e21 Mon Sep 17 00:00:00 2001
From: Matus Valo <matusvalo@gmail.com>
Date: Mon, 17 Apr 2023 23:00:04 +0200
Subject: [PATCH] Mark function pointer ctypedefs as noexcept
---
scipy/cluster/_hierarchy_distance_update.pxi | 2 +-
scipy/optimize/cython_optimize/_zeros.pxd | 2 +-
scipy/stats/_qmc_cy.pyx | 2 +-
scipy/stats/_unuran/unuran_wrapper.pyx.templ | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/scipy/cluster/_hierarchy_distance_update.pxi b/scipy/cluster/_hierarchy_distance_update.pxi
index 17dedb305..bc57a3fa1 100644
--- a/scipy/cluster/_hierarchy_distance_update.pxi
+++ b/scipy/cluster/_hierarchy_distance_update.pxi
@@ -24,7 +24,7 @@ d_xyi : double
"""
ctypedef double (*linkage_distance_update)(double d_xi, double d_yi,
double d_xy, int size_x,
- int size_y, int size_i)
+ int size_y, int size_i) noexcept
cdef double _single(double d_xi, double d_yi, double d_xy,
diff --git a/scipy/optimize/cython_optimize/_zeros.pxd b/scipy/optimize/cython_optimize/_zeros.pxd
index c6241d022..d3c9e98f0 100644
--- a/scipy/optimize/cython_optimize/_zeros.pxd
+++ b/scipy/optimize/cython_optimize/_zeros.pxd
@@ -4,7 +4,7 @@
# should be made to this file** --- any API additions/changes should be
# done in `cython_optimize.pxd` (see gh-11793).
-ctypedef double (*callback_type)(double, void*)
+ctypedef double (*callback_type)(double, void*) noexcept
ctypedef struct zeros_parameters:
callback_type function
diff --git a/scipy/stats/_qmc_cy.pyx b/scipy/stats/_qmc_cy.pyx
index f165cb0d1..a9e94354f 100644
--- a/scipy/stats/_qmc_cy.pyx
+++ b/scipy/stats/_qmc_cy.pyx
@@ -290,7 +290,7 @@ cdef double c_update_discrepancy(double[::1] x_new_view,
ctypedef double (*func_type)(double[:, ::1], Py_ssize_t,
- Py_ssize_t) nogil
+ Py_ssize_t) noexcept nogil
cdef double threaded_loops(func_type loop_func,
diff --git a/scipy/stats/_unuran/unuran_wrapper.pyx.templ b/scipy/stats/_unuran/unuran_wrapper.pyx.templ
index 2279dfc34..9eb63fb1c 100644
--- a/scipy/stats/_unuran/unuran_wrapper.pyx.templ
+++ b/scipy/stats/_unuran/unuran_wrapper.pyx.templ
@@ -58,7 +58,7 @@ class UNURANError(RuntimeError):
pass
-ctypedef double (*URNG_FUNCT)(void *) nogil
+ctypedef double (*URNG_FUNCT)(void *) noexcept nogil
IF not NPY_OLD:
cdef object get_numpy_rng(object seed = None):
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shafeipaozi/scipy.git
git@gitee.com:shafeipaozi/scipy.git
shafeipaozi
scipy
scipy
master

搜索帮助