Skip to content

Commit

Permalink
Merge pull request #390 from nauaneed/fix-tests
Browse files Browse the repository at this point in the history
Fix build and tests
  • Loading branch information
prabhuramachandran authored Dec 9, 2023
2 parents 16b3b0b + 2acb4ae commit b94cc72
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 67 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9]
python-version: [3.11]

runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
Expand All @@ -39,7 +39,8 @@ jobs:
- name: Install dependencies
run: |
conda info
conda install -c conda-forge numpy cython h5py
conda install -c conda-forge numpy 'cython<3.0' 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
python -m pip install -r requirements.txt -r requirements-test.txt
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/zoltan-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
python-version: [3.11]

env:
USE_TRILINOS: 1
Expand All @@ -26,22 +26,24 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Linux packages ZOLTAN support
run: |
sudo apt-get update
sudo apt-get install -y openmpi-bin libopenmpi-dev libtrilinos-zoltan-dev
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
- name: Install dependencies
run: |
conda info
conda install -c conda-forge numpy cython
python -m pip install mpi4py cyarray
conda install -c conda-forge numpy 'cython<3.0'
python -m pip install --upgrade pip setuptools wheel
python -m pip install mpi4py
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 -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
requires = [
"Beaker",
"Cython>=0.20",
"Cython<3.0",
"compyle>=0.8",
"cyarray",
"mako",
Expand Down
2 changes: 1 addition & 1 deletion pysph/base/linalg3.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ from numpy.linalg import eigh
cimport numpy
import numpy

cdef extern:
cdef extern from "math.h":
double fabs(double) nogil

# this is cython substitute for const values
Expand Down
7 changes: 0 additions & 7 deletions pysph/base/nnps_base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ ELSE:
cpdef set_number_of_threads(int n):
print("OpenMP not available, cannot set number of threads.")


IF UNAME_SYSNAME == "Windows":
cdef inline double fmin(double x, double y) nogil:
return x if x < y else y
cdef inline double fmax(double x, double y) nogil:
return x if x > y else y

# Particle Tag information
from cyarray.carray cimport BaseArray, aligned_malloc, aligned_free
from .utils import ParticleTAGS
Expand Down
6 changes: 0 additions & 6 deletions pysph/base/octree.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ from cython.parallel import parallel, prange, threadid
# EPS_MAX is maximum value of eps in tree building
DEF EPS_MAX = 1e-3

IF UNAME_SYSNAME == "Windows":
cdef inline double fmin(double x, double y) nogil:
return x if x < y else y
cdef inline double fmax(double x, double y) nogil:
return x if x > y else y

ctypedef cOctreeNode* node_ptr
ctypedef double* dbl_ptr

Expand Down
7 changes: 0 additions & 7 deletions pysph/base/octree_nnps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ from libc.stdlib cimport malloc, free
cimport cython
from cython.operator cimport dereference as deref, preincrement as inc

IF UNAME_SYSNAME == "Windows":
cdef inline double fmin(double x, double y) nogil:
return x if x < y else y
cdef inline double fmax(double x, double y) nogil:
return x if x > y else y


#############################################################################
cdef class OctreeNNPS(NNPS):
"""Nearest neighbor search using Octree.
Expand Down
7 changes: 0 additions & 7 deletions pysph/base/spatial_hash_nnps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ from libcpp.vector cimport vector
# Cython for compiler directives
cimport cython

IF UNAME_SYSNAME == "Windows":
cdef inline double fmin(double x, double y) nogil:
return x if x < y else y
cdef inline double fmax(double x, double y) nogil:
return x if x > y else y


#############################################################################
cdef class SpatialHashNNPS(NNPS):

Expand Down
6 changes: 0 additions & 6 deletions pysph/base/stratified_hash_nnps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ cimport cython

DEF EPS = 1e-6

IF UNAME_SYSNAME == "Windows":
cdef inline double fmin(double x, double y) nogil:
return x if x < y else y
cdef inline double fmax(double x, double y) nogil:
return x if x > y else y

#############################################################################
cdef class StratifiedHashNNPS(NNPS):

Expand Down
7 changes: 0 additions & 7 deletions pysph/base/stratified_sfc_gpu_nnps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ cdef extern from *:
#endif
"""

IF UNAME_SYSNAME == "Windows":
cdef inline double fmin(double x, double y) nogil:
return x if x < y else y
cdef inline double fmax(double x, double y) nogil:
return x if x > y else y


cdef class StratifiedSFCGPUNNPS(GPUNNPS):
def __init__(self, int dim, list particles, double radius_scale=2.0,
int ghost_layers=1, domain=None, bint fixed_h=False,
Expand Down
7 changes: 0 additions & 7 deletions pysph/base/stratified_sfc_nnps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ cdef extern from *:
#endif
"""

IF UNAME_SYSNAME == "Windows":
cdef inline double fmin(double x, double y) nogil:
return x if x < y else y
cdef inline double fmax(double x, double y) nogil:
return x if x > y else y


#############################################################################
cdef class StratifiedSFCNNPS(NNPS):

Expand Down
7 changes: 0 additions & 7 deletions pysph/base/z_order_gpu_nnps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ cdef extern from *:
#endif
"""

IF UNAME_SYSNAME == "Windows":
cdef inline double fmin(double x, double y) nogil:
return x if x < y else y
cdef inline double fmax(double x, double y) nogil:
return x if x > y else y


cdef class ZOrderGPUNNPS(GPUNNPS):
def __init__(self, int dim, list particles, double radius_scale=2.0,
int ghost_layers=1, domain=None, bint fixed_h=False,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
numpy
setuptools>=42.0.0
Cython>=0.20
Cython<3.0
cyarray
compyle>=0.8
mako
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ def setup_package():

# The requirements.
install_requires = [
'numpy', 'mako', 'cyarray', 'compyle>=0.8', 'Cython>=0.20',
'numpy', 'mako', 'cyarray', 'compyle>=0.8', 'Cython<3.0',
'setuptools>=42.0.0', 'pytools', 'Beaker'
]
tests_require = ['pytest>=3.0', 'h5py', 'vtk']
Expand Down

0 comments on commit b94cc72

Please sign in to comment.