Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add noexcept to lintegrate_callback to prevent Cython error #28

Merged
merged 8 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,27 @@ jobs:
build:
strategy:
matrix:
os: [ubuntu-20.04, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-20.04, ubuntu-22.04, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, "3.10"]
include:
- os: ubuntu-20.04
ccompiler: "c-compiler"
condainstall: "cython numpy pip pytest setuptools"
- os: ubuntu-22.04
condainstall: "cython numpy pip pytest setuptools"
- os: windows-latest
ccompiler: "c-compiler"
condainstall: "c-compiler cython gsl numpy pip pytest setuptools"
- os: macos-latest
ccompiler: "c-compiler 'clang>=12.0.1'"
condainstall: "c-compiler 'clang>=12.0.1' cython gsl numpy pip pytest setuptools"
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}

steps:
- if: ${{ matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' }}
run: |
apt install libgsl-dev
apt list --installed | grep gsl
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -36,7 +42,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
conda install -n test -q -y ${{ matrix.ccompiler }} cython gsl numpy pip pytest setuptools
conda install -n test -q -y ${{ matrix.condainstall }}
- name: Conda information
run: |
conda info --all
Expand Down
2 changes: 1 addition & 1 deletion lintegrate/lintegrate.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,6 @@ def lcquad(func, a, b, args=(), epsabs=1.49e-8, epsrel=1.49e-8, wsintervals=100,

# callback function to allow python functions to be passed to C lintegration functions
# (see e.g. https://github.com/cython/cython/tree/master/Demos/callback)
cdef double lintegrate_callback(double x, void *f, void *args):
cdef double lintegrate_callback(double x, void *f, void *args) noexcept:
return (<object>f)(x, <object>args)

Loading