Skip to content

Commit 93b5418

Browse files
authored
Merge branch 'master' into dependabot/github_actions/pypa/gh-action-pypi-publish-1.12.4
2 parents 564dc0a + 1457e9b commit 93b5418

File tree

4 files changed

+47
-125
lines changed

4 files changed

+47
-125
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -13,96 +13,23 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: ["ubuntu-20.04", "ubuntu-latest", "macos-latest"]
17-
compiler: [gcc-7, gcc-9, clang]
18-
python-version: ["3.9", "3.12"]
19-
numpy-version: ["1.20", "2.0.1"]
20-
2116
include:
22-
- numpy-version: "1.23"
23-
compiler: gcc-10
24-
python-version: "3.10"
25-
os: ubuntu-latest
26-
27-
- numpy-version: "1.23"
28-
compiler: gcc-11
29-
python-version: "3.10"
30-
os: ubuntu-latest
31-
32-
- numpy-version: "1.23"
33-
compiler: gcc-10
34-
python-version: "3.10"
35-
os: ubuntu-latest
36-
37-
- numpy-version: "1.23"
38-
compiler: gcc-11
39-
python-version: "3.10"
40-
os: ubuntu-latest
41-
42-
- numpy-version: "1.23"
43-
compiler: gcc-10
44-
python-version: "3.11"
45-
os: ubuntu-latest
46-
47-
- numpy-version: "1.23"
48-
compiler: gcc-11
49-
python-version: "3.11"
50-
os: ubuntu-latest
51-
52-
- numpy-version: "1.23"
53-
compiler: gcc-12
54-
python-version: "3.11"
55-
os: ubuntu-latest
56-
57-
- numpy-version: "1.23"
58-
compiler: gcc-10
59-
python-version: "3.11"
60-
os: ubuntu-latest
61-
62-
- numpy-version: "1.23"
63-
compiler: gcc-11
64-
python-version: "3.11"
65-
os: ubuntu-latest
66-
67-
- numpy-version: "1.23"
68-
compiler: gcc-12
69-
python-version: "3.11"
70-
os: ubuntu-latest
71-
72-
exclude:
73-
# Only run with 'clang' on OSX
74-
- os: "macos-latest"
75-
compiler: gcc-7
76-
- os: "macos-latest"
77-
compiler: gcc-9
78-
79-
# Don't use 'clang' on linux
80-
- os: "ubuntu-20.04"
17+
- os: ubuntu-24.04
18+
compiler: gcc
19+
python-version: 3.9
20+
numpy-version: 1
21+
- os: ubuntu-24.04
22+
compiler: gcc
23+
python-version: 3.13
24+
numpy-version: 2
25+
- os: macos-14
8126
compiler: clang
82-
- os: "ubuntu-latest"
27+
python-version: 3.9
28+
numpy-version: 1
29+
- os: macos-14
8330
compiler: clang
84-
85-
# only gcc-10 on latest
86-
- os: "ubuntu-latest"
87-
compiler: gcc-9
88-
- os: "ubuntu-latest"
89-
compiler: gcc-7
90-
91-
# Only use latest numpy on ubuntu-latest
92-
- os: "ubuntu-latest"
93-
numpy-version: 1.20
94-
95-
# python3.10 only on ubuntu-latest
96-
# - os: "ubuntu-20.04"
97-
# python-version: "3.10"
98-
# - os: "macos-latest"
99-
# python-version: "3.10"
100-
101-
- python-version: "3.9"
102-
numpy-version: "2.0.1"
103-
104-
- python-version: "3.12"
105-
numpy-version: "1.20"
31+
python-version: 3.13
32+
numpy-version: 2
10633

10734
env:
10835
CC: ${{ matrix.compiler }}
@@ -116,32 +43,16 @@ jobs:
11643
uses: conda-incubator/setup-miniconda@v3
11744
with:
11845
auto-update-conda: true
46+
miniforge-version: latest
47+
conda-remove-defaults: true
11948
auto-activate-base: false
120-
miniconda-version: 'latest'
121-
python-version: ${{ matrix.python-version }}
122-
123-
# This was needed on 18.04 but not on 20.04
124-
# - name: Install binutils on linux
125-
# shell: bash -l {0}
126-
# if: matrix.os == 'ubuntu-18.04'
127-
# run: |
128-
# sudo apt-get update
129-
# sudo apt-get install binutils
130-
131-
- name: Install gcc-7 on ubuntu-20.04
132-
shell: bash -l {0}
133-
if: matrix.os == 'ubuntu-20.04'
134-
run: |
135-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
136-
sudo apt-get update
137-
sudo apt-get install gcc-7
49+
activate-environment: ""
13850

13951
- name: Install dependencies
14052
shell: bash -l {0}
14153
run: |
142-
conda create -q --yes -n test python=${{ matrix.python-version }} nomkl
54+
conda create -n test python=${{ matrix.python-version }} numpy=${{ matrix.numpy-version }} nomkl gsl
14355
conda activate test
144-
conda install -q --yes -c conda-forge numpy=${{ matrix.numpy-version }} gsl
14556
14657
- name: Display PATH, compiler, python
14758
shell: bash -l {0}
@@ -156,48 +67,56 @@ jobs:
15667
echo `${{ matrix.compiler }} -dM -E - -march=native`
15768
15869
- name: lscpu on Linux
159-
if: matrix.os != 'macos-latest'
70+
if: matrix.os != 'macos-14'
16071
run: |
16172
lscpu
16273
16374
- name: sysctl machdep.cpu on OSX
164-
if: matrix.os == 'macos-latest'
75+
if: matrix.os == 'macos-14'
16576
run: |
16677
sysctl machdep.cpu
16778
168-
# - name: Add linker flag to OSX + gcc
169-
# shell: bash -l {0}
170-
# if: matrix.os == 'osx-latest' && startswith(matrix.compiler, 'gcc')
171-
# run: export CLINK = '-lgomp'
172-
17379
- name: compile
17480
shell: bash -l {0}
175-
run: make -r CC=${{ matrix.compiler }}
81+
run: |
82+
conda activate test
83+
make -r CC=${{ matrix.compiler }}
17684
17785
- name: install
17886
shell: bash -l {0}
179-
run: make install CC=${{ matrix.compiler }}
87+
run: |
88+
conda activate test
89+
make install CC=${{ matrix.compiler }}
18090
18191
- name: compile and install python extensions
18292
shell: bash -l {0}
18393
run: |
94+
conda activate test
18495
echo "CC = " $CC
18596
export CC=${{ matrix.compiler }}
18697
python -m pip install -e .
18798
18899
- name: tests
189100
shell: bash -l {0}
190-
run: make tests CC=${{ matrix.compiler }}
101+
run: |
102+
conda activate test
103+
make tests CC=${{ matrix.compiler }}
191104
192105
- name: doctests
193106
shell: bash -l {0}
194-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' && matrix.numpy-version == '1.16'
107+
if: matrix.os == 'ubuntu-24.04' && matrix.python-version == '3.13' && matrix.numpy-version == '2'
195108
run: |
109+
conda activate test
196110
python -m pip install 'sphinx>=1.8'
197111
make -C docs doctest
198112
199113
- name: Python tests
200114
shell: bash -l {0}
201115
run: |
116+
conda activate test
117+
if [ "${{ matrix.os }}" = "macos-14" ]; then
118+
# We currently don't build with OpenMP on MacOS in CI
119+
export CORRFUNC_PYTEST_MAX_THREADS=1
120+
fi
202121
python -m pip install pytest
203122
python -m pytest -v

Corrfunc/tests/common.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ def maxthreads():
5454
maxthreads = len(os.sched_getaffinity(0))
5555
except AttributeError:
5656
maxthreads = multiprocessing.cpu_count() or 1
57+
58+
environ_max = os.environ.get('CORRFUNC_PYTEST_MAX_THREADS')
59+
if environ_max:
60+
maxthreads = min(int(environ_max), maxthreads)
5761

5862
return maxthreads
5963

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

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

7073
combos = []
7174
all_isa = ['fallback','sse42','avx','avx512f']
7275
if extra_isa:
7376
all_isa += extra_isa
7477
combos += [(isa,mx) for isa in all_isa]
75-
combos += [('fastest',n) for n in all_nthreads]
78+
combos += [('fastest',n) for n in extra_nthreads]
7679

7780
return combos
7881

Corrfunc/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def fix_ra_dec(ra, dec):
456456
if max(dec) > 90.0:
457457
print("Warning: found DEC values more than 90.0; wrapping into "
458458
"[-90.0, 90.0] range")
459-
dec += 90.0
459+
dec -= 90.0
460460

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

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
#
8484
# This is also used if you do content translation via gettext catalogs.
8585
# Usually you set "language" from the command line for these cases.
86-
language = None
86+
language = 'en'
8787

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

376376

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

380380
del sys.path[0]

0 commit comments

Comments
 (0)