Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
revert build to older cython
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cortes committed Jul 25, 2023
1 parent fbd7aa7 commit c58f6d8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
8 changes: 7 additions & 1 deletion ctpfrec/cy_double.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ from scipy.linalg.cython_blas cimport ddot
from hpfrec import cython_loops_double as cython_loops
import ctypes

from libc.math cimport log, exp, HUGE_VAL, HUGE_VALL
# TODO: once issues with newer cython are sorted out, should cimport as below:
# from libc.math cimport log, exp, HUGE_VAL, HUGE_VALL
cdef extern from "<math.h>":
double log(double x) nogil
double exp(double x) nogil
const double HUGE_VAL
const long double HUGE_VALL

c_real_t = ctypes.c_double
ctypedef double real_t
Expand Down
11 changes: 10 additions & 1 deletion ctpfrec/cy_float.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ from scipy.special.cython_special cimport psi, gamma
from hpfrec import cython_loops_float as cython_loops
import ctypes

from libc.math cimport log, exp, logf, expf, HUGE_VALF, HUGE_VAL, HUGE_VALL
# TODO: once issues with newer cython are sorted out, should cimport as below:
# from libc.math cimport log, exp, logf, expf, HUGE_VALF, HUGE_VAL, HUGE_VALL
cdef extern from "<math.h>":
double log(double x) nogil
float logf(float) nogil
double exp(double x) nogil
float expf(float) nogil
const float HUGE_VALF
const double HUGE_VAL
const long double HUGE_VALL

c_real_t = ctypes.c_float
ctypedef float real_t
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[build-system]
requires = ["cython>=3.0.0", "setuptools", "wheel", "numpy>=1.25", "scipy>=1.11.1"]
requires = ["cython==0.29.36", "setuptools", "wheel", "numpy>=1.25", "scipy>=1.11.1"]
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pandas
numpy>=1.25
scipy>=1.11.1
cython>=3.0.0
hpfrec>=0.2.3
cython
hpfrec>=0.2.10
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def test_supports_compile_arg(self, comm, with_omp=False):
setup(
name = 'ctpfrec',
packages = ['ctpfrec'],
version = '0.1.17',
version = '0.1.18',
description = 'Collaborative topic Poisson factorization for recommender systems',
author = 'David Cortes',
url = 'https://github.com/david-cortes/ctpfrec',
Expand Down

0 comments on commit c58f6d8

Please sign in to comment.