From 95867bd424b9cbc111e81d3b72022bf0abe885f8 Mon Sep 17 00:00:00 2001 From: Jesse Livezey Date: Wed, 18 Oct 2023 16:08:25 -0400 Subject: [PATCH] fixed cython compile error and np.int --- src/pyuoi/lbfgs/_lowlevel.pyx | 4 ++-- src/pyuoi/mpi_utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pyuoi/lbfgs/_lowlevel.pyx b/src/pyuoi/lbfgs/_lowlevel.pyx index c6d27b4..7afad38 100644 --- a/src/pyuoi/lbfgs/_lowlevel.pyx +++ b/src/pyuoi/lbfgs/_lowlevel.pyx @@ -108,7 +108,7 @@ cdef class CallbackData(object): # Callback into Python evaluation callable. cdef lbfgsfloatval_t call_eval(void *cb_data_v, lbfgsconst_p x, lbfgsfloatval_t *g, - int n, lbfgsfloatval_t step): + int n, lbfgsfloatval_t step) noexcept: cdef object cb_data cdef np.npy_intp tshape[1] @@ -126,7 +126,7 @@ cdef int call_progress(void *cb_data_v, lbfgsconst_p x, lbfgsconst_p g, lbfgsfloatval_t fx, lbfgsfloatval_t xnorm, lbfgsfloatval_t gnorm, - lbfgsfloatval_t step, int n, int k, int ls): + lbfgsfloatval_t step, int n, int k, int ls) noexcept: cdef object cb_data cdef np.npy_intp tshape[1] diff --git a/src/pyuoi/mpi_utils.py b/src/pyuoi/mpi_utils.py index 43ffd1c..4c3f3e9 100644 --- a/src/pyuoi/mpi_utils.py +++ b/src/pyuoi/mpi_utils.py @@ -8,7 +8,7 @@ from mpi4py import MPI _np2mpi = {np.dtype(np.float32): MPI.FLOAT, np.dtype(np.float64): MPI.DOUBLE, - np.dtype(np.int): MPI.LONG, + np.dtype(int): MPI.LONG, np.dtype(np.intc): MPI.INT} except ImportError: pass