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

Bump cython, fixes for tests, and fixes for deprecation warnings #400

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e45d896
fix(tests): nose deprecation
nauaneed Feb 16, 2024
7149b86
ci(gha): update cache action
nauaneed Feb 16, 2024
8f85207
Revert "fix(tests): pin python<3.0"
nauaneed Aug 16, 2024
8308764
fix(point.pyx): cython numpy.int_t invalid type
nauaneed Aug 16, 2024
bcf2e83
fix(perf): by adding noexcept
nauaneed Aug 17, 2024
126efe3
chore(c_kernel): methods are marked noexcept nogil
nauaneed Aug 18, 2024
eb842ab
ci(macos): use omp enabled homebrew-llvm-clang
nauaneed Aug 20, 2024
8718a90
fix(test_reduce_array): np.alltrue() is deprecated
nauaneed Sep 21, 2024
9d12c56
fix(geometry.py): use factorial from math instead of np.math
nauaneed Sep 21, 2024
20096c3
ci: don't cancel tests if one fails
nauaneed Sep 21, 2024
7bd81b7
chore(setup.py): eliminate deprecation warnings
nauaneed Sep 21, 2024
0f9b4b9
chore: no problem if cython removes `IF`
nauaneed Sep 21, 2024
bae1d82
chore(nnps_base.pyx): settle deprecation warnings
nauaneed Sep 21, 2024
47d46f2
chore(cell_indexing_nnps): settle deprecation warnings
nauaneed Sep 21, 2024
c7b1ce2
chore(octree): settle deprecation warnings
nauaneed Sep 21, 2024
da8a225
chore(octree_nnps): settle deprecation warnings
nauaneed Sep 21, 2024
e3c4f73
chore(spatial_hash_nnps): settle deprecation warnings
nauaneed Sep 21, 2024
eead8ea
chore(stratified_hash_nnps): settle deprecation warnings
nauaneed Sep 21, 2024
5caa869
chore(stratified_sfc_gpu_nnps): settle deprecation warnings
nauaneed Sep 21, 2024
d4b8f99
chore(stratified_sfc_nnps): settle deprecation warnings
nauaneed Sep 21, 2024
d30cda3
chore(z_order_gpu_nnps): settle deprecation warnings
nauaneed Sep 22, 2024
b2c0900
chore(z_order_nnps): settle deprecation warnings
nauaneed Sep 22, 2024
d349325
chore(point.pyx): settle deprecation warnings
nauaneed Sep 22, 2024
6e5be66
chore(linalg3): settle deprecation warnings
nauaneed Sep 22, 2024
fa57cc3
chore(deps): build using numpy>2.0
nauaneed Sep 23, 2024
fc8046d
ci(zoltan/mpi): pin mpi4py<4.0
nauaneed Sep 26, 2024
e33482e
chore: no more depend on pre-NumPy-1.7 C-API
nauaneed Sep 26, 2024
7bbf1ca
fix(test_equations): use numpy.all, not numpy.alltrue
nauaneed Sep 26, 2024
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
19 changes: 17 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.11]
Expand All @@ -36,10 +37,24 @@ jobs:
conda install -c conda-forge pocl pyopencl
python -c 'import pyopencl as cl'
if: ${{ runner.os != 'Windows' }}
- name: Setup compyle config on MacOS to use openmp enabled clang from homebrew
run: |
brew install libomp
mkdir -p ~/.compyle
touch ~/.compyle/config.py
echo "import os" >> ~/.compyle/config.py
echo "os.environ['CC'] = '$(brew --prefix llvm@15)/bin/clang'" >> ~/.compyle/config.py
echo "os.environ['CXX'] = '$(brew --prefix llvm@15)/bin/clang++'" >> ~/.compyle/config.py
export CPPFLAGS="-I$(brew --prefix libomp)/include -I$(brew --prefix llvm@15)/include -Xclang -fopenmp"
export LDFLAGS="-L$(brew --prefix libomp)/lib -L$(brew --prefix llvm@15)/lib -lomp"
python -c "import os; OMP_CFLAGS=os.environ.get('CPPFLAGS').split(' '); print(f'{OMP_CFLAGS=}')" >> ~/.compyle/config.py
python -c "import os; OMP_LINK=os.environ.get('LDFLAGS').split(' '); print(f'{OMP_LINK=}')" >> ~/.compyle/config.py
cat ~/.compyle/config.py
if: ${{ runner.os == 'macOS' }}
- name: Install dependencies
run: |
conda info
conda install -c conda-forge numpy 'cython<3.0' h5py
conda install -c conda-forge numpy cython h5py
python -m pip install --upgrade pip setuptools wheel
python -m pip install https://github.com/pypr/cyarray/zipball/master
python -m pip install https://github.com/pypr/compyle/zipball/master
Expand All @@ -52,7 +67,7 @@ jobs:
id: month
run: echo "month==$(date +'%m')" >> $GITHUB_OUTPUT
- name: Deal with auto-generated code cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.pysph
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/zoltan-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ jobs:
- name: Install dependencies
run: |
conda info
conda install -c conda-forge numpy 'cython<3.0'
conda install -c conda-forge numpy cython
python -m pip install --upgrade pip setuptools wheel
python -m pip install mpi4py
python -m pip install "mpi4py<4.0"
python -m pip install https://github.com/pypr/cyarray/zipball/master
python -m pip install --no-build-isolation https://github.com/pypr/pyzoltan/zipball/master
python -m pip install https://github.com/pypr/compyle/zipball/master
python -m pip install --no-build-isolation https://github.com/pypr/pyzoltan/zipball/master
python -m pip install -r requirements.txt
python -m pip install -r requirements-test.txt
python setup.py develop
Expand All @@ -55,7 +55,7 @@ jobs:
id: month
run: echo "month==$(date +'%m')" >> $GITHUB_OUTPUT
- name: Deal with auto-generated code cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.pysph
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[build-system]
requires = [
"Beaker",
"Cython<3.0",
"Cython>=0.20",
"compyle>=0.8",
"cyarray",
"mako",
"oldest-supported-numpy",
"numpy>=2.0,<3",
"pytools",
"setuptools>=42.0.0",
"wheel>=0.29.0",
Expand Down
2 changes: 2 additions & 0 deletions pysph/base/box_sort_nnps.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# cython: language_level=3, embedsignature=True
# distutils: language=c++
# distutils: define_macros=NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION

from libcpp.map cimport map

from .nnps_base cimport *
Expand Down
7 changes: 5 additions & 2 deletions pysph/base/box_sort_nnps.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# cython: language_level=3, language=c++, embedsignature=True
# cython: language_level=3, embedsignature=True
# distutils: language=c++
# distutils: define_macros=NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION

# Library imports.
import numpy as np
cimport numpy as np
Expand Down Expand Up @@ -42,7 +45,7 @@ cdef class BoxSortNNPS(LinkedListNNPS):
@cython.boundscheck(False)
@cython.wraparound(False)
cdef inline long _get_valid_cell_index(self, int cid_x, int cid_y, int cid_z,
int* ncells_per_dim, int dim, int n_cells) nogil:
int* ncells_per_dim, int dim, int n_cells) noexcept nogil:
"""Return the flattened index for a valid cell"""
cdef long ncx = ncells_per_dim[0]
cdef long ncy = ncells_per_dim[1]
Expand Down
Loading
Loading