Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/github_actions/pypa/gh-action-p…
Browse files Browse the repository at this point in the history
…ypi-publish-1.12.4
  • Loading branch information
lgarrison authored Feb 13, 2025
2 parents 564dc0a + 1457e9b commit 93b5418
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 125 deletions.
155 changes: 37 additions & 118 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,96 +13,23 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04", "ubuntu-latest", "macos-latest"]
compiler: [gcc-7, gcc-9, clang]
python-version: ["3.9", "3.12"]
numpy-version: ["1.20", "2.0.1"]

include:
- numpy-version: "1.23"
compiler: gcc-10
python-version: "3.10"
os: ubuntu-latest

- numpy-version: "1.23"
compiler: gcc-11
python-version: "3.10"
os: ubuntu-latest

- numpy-version: "1.23"
compiler: gcc-10
python-version: "3.10"
os: ubuntu-latest

- numpy-version: "1.23"
compiler: gcc-11
python-version: "3.10"
os: ubuntu-latest

- numpy-version: "1.23"
compiler: gcc-10
python-version: "3.11"
os: ubuntu-latest

- numpy-version: "1.23"
compiler: gcc-11
python-version: "3.11"
os: ubuntu-latest

- numpy-version: "1.23"
compiler: gcc-12
python-version: "3.11"
os: ubuntu-latest

- numpy-version: "1.23"
compiler: gcc-10
python-version: "3.11"
os: ubuntu-latest

- numpy-version: "1.23"
compiler: gcc-11
python-version: "3.11"
os: ubuntu-latest

- numpy-version: "1.23"
compiler: gcc-12
python-version: "3.11"
os: ubuntu-latest

exclude:
# Only run with 'clang' on OSX
- os: "macos-latest"
compiler: gcc-7
- os: "macos-latest"
compiler: gcc-9

# Don't use 'clang' on linux
- os: "ubuntu-20.04"
- os: ubuntu-24.04
compiler: gcc
python-version: 3.9
numpy-version: 1
- os: ubuntu-24.04
compiler: gcc
python-version: 3.13
numpy-version: 2
- os: macos-14
compiler: clang
- os: "ubuntu-latest"
python-version: 3.9
numpy-version: 1
- os: macos-14
compiler: clang

# only gcc-10 on latest
- os: "ubuntu-latest"
compiler: gcc-9
- os: "ubuntu-latest"
compiler: gcc-7

# Only use latest numpy on ubuntu-latest
- os: "ubuntu-latest"
numpy-version: 1.20

# python3.10 only on ubuntu-latest
# - os: "ubuntu-20.04"
# python-version: "3.10"
# - os: "macos-latest"
# python-version: "3.10"

- python-version: "3.9"
numpy-version: "2.0.1"

- python-version: "3.12"
numpy-version: "1.20"
python-version: 3.13
numpy-version: 2

env:
CC: ${{ matrix.compiler }}
Expand All @@ -116,32 +43,16 @@ jobs:
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
miniforge-version: latest
conda-remove-defaults: true
auto-activate-base: false
miniconda-version: 'latest'
python-version: ${{ matrix.python-version }}

# This was needed on 18.04 but not on 20.04
# - name: Install binutils on linux
# shell: bash -l {0}
# if: matrix.os == 'ubuntu-18.04'
# run: |
# sudo apt-get update
# sudo apt-get install binutils

- name: Install gcc-7 on ubuntu-20.04
shell: bash -l {0}
if: matrix.os == 'ubuntu-20.04'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-7
activate-environment: ""

- name: Install dependencies
shell: bash -l {0}
run: |
conda create -q --yes -n test python=${{ matrix.python-version }} nomkl
conda create -n test python=${{ matrix.python-version }} numpy=${{ matrix.numpy-version }} nomkl gsl
conda activate test
conda install -q --yes -c conda-forge numpy=${{ matrix.numpy-version }} gsl
- name: Display PATH, compiler, python
shell: bash -l {0}
Expand All @@ -156,48 +67,56 @@ jobs:
echo `${{ matrix.compiler }} -dM -E - -march=native`
- name: lscpu on Linux
if: matrix.os != 'macos-latest'
if: matrix.os != 'macos-14'
run: |
lscpu
- name: sysctl machdep.cpu on OSX
if: matrix.os == 'macos-latest'
if: matrix.os == 'macos-14'
run: |
sysctl machdep.cpu
# - name: Add linker flag to OSX + gcc
# shell: bash -l {0}
# if: matrix.os == 'osx-latest' && startswith(matrix.compiler, 'gcc')
# run: export CLINK = '-lgomp'

- name: compile
shell: bash -l {0}
run: make -r CC=${{ matrix.compiler }}
run: |
conda activate test
make -r CC=${{ matrix.compiler }}
- name: install
shell: bash -l {0}
run: make install CC=${{ matrix.compiler }}
run: |
conda activate test
make install CC=${{ matrix.compiler }}
- name: compile and install python extensions
shell: bash -l {0}
run: |
conda activate test
echo "CC = " $CC
export CC=${{ matrix.compiler }}
python -m pip install -e .
- name: tests
shell: bash -l {0}
run: make tests CC=${{ matrix.compiler }}
run: |
conda activate test
make tests CC=${{ matrix.compiler }}
- name: doctests
shell: bash -l {0}
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' && matrix.numpy-version == '1.16'
if: matrix.os == 'ubuntu-24.04' && matrix.python-version == '3.13' && matrix.numpy-version == '2'
run: |
conda activate test
python -m pip install 'sphinx>=1.8'
make -C docs doctest
- name: Python tests
shell: bash -l {0}
run: |
conda activate test
if [ "${{ matrix.os }}" = "macos-14" ]; then
# We currently don't build with OpenMP on MacOS in CI
export CORRFUNC_PYTEST_MAX_THREADS=1
fi
python -m pip install pytest
python -m pytest -v
11 changes: 7 additions & 4 deletions Corrfunc/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ def maxthreads():
maxthreads = len(os.sched_getaffinity(0))
except AttributeError:
maxthreads = multiprocessing.cpu_count() or 1

environ_max = os.environ.get('CORRFUNC_PYTEST_MAX_THREADS')
if environ_max:
maxthreads = min(int(environ_max), maxthreads)

return maxthreads

Expand All @@ -63,16 +67,15 @@ def generate_isa_and_nthreads_combos(extra_isa=None):
mx = maxthreads()

# the ISA sweep will use maxthreads
# and then with the fastest ISA, we will test single-threaded,
# plus "oversubscribed", where we use more threads than cores
all_nthreads = [1,mx+1]
# and then with the fastest ISA, we will test single-threaded
extra_nthreads = [1] if mx > 1 else []

combos = []
all_isa = ['fallback','sse42','avx','avx512f']
if extra_isa:
all_isa += extra_isa
combos += [(isa,mx) for isa in all_isa]
combos += [('fastest',n) for n in all_nthreads]
combos += [('fastest',n) for n in extra_nthreads]

return combos

Expand Down
2 changes: 1 addition & 1 deletion Corrfunc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def fix_ra_dec(ra, dec):
if max(dec) > 90.0:
print("Warning: found DEC values more than 90.0; wrapping into "
"[-90.0, 90.0] range")
dec += 90.0
dec -= 90.0

return ra.astype(input_dtype), dec.astype(input_dtype)

Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -375,6 +375,6 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {'python': ('https://docs.python.org/', None)}

del sys.path[0]

0 comments on commit 93b5418

Please sign in to comment.