Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5e9ce0c

Browse files
Merge branch 'numpy:main' into as_min_max
2 parents 2ff7ab6 + 056abda commit 5e9ce0c

360 files changed

Lines changed: 16199 additions & 6280 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ jobs:
4444
. venv/bin/activate
4545
pip install --progress-bar=off --upgrade pip 'setuptools<49.2.0'
4646
pip install --progress-bar=off -r test_requirements.txt
47-
pip install .
4847
pip install --progress-bar=off -r doc_requirements.txt
48+
pip install .
4949
5050
- run:
5151
name: create release notes

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Bug report
22
description: Report a bug. For security vulnerabilities see Report a security vulnerability in the templates.
3-
title: "BUG: "
3+
title: "BUG: <Please write a comprehensive title after the 'BUG: ' prefix>"
44
labels: [00 - Bug]
55

66
body:
@@ -35,10 +35,12 @@ body:
3535
attributes:
3636
label: "Error message:"
3737
description: >
38-
Please include full error message, if any (starting from `Traceback: ...`).
38+
Please include full error message, if any.
3939
If you are reporting a segfault please include a GDB traceback,
4040
which you can generate by following
4141
[these instructions](https://github.com/numpy/numpy/blob/main/doc/source/dev/development_environment.rst#debugging).
42+
placeholder: |
43+
<< Full traceback starting from `Traceback: ...` >>
4244
render: shell
4345

4446
- type: textarea

.github/ISSUE_TEMPLATE/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Documentation
22
description: Report an issue related to the NumPy documentation.
3-
title: "DOC: "
3+
title: "DOC: <Please write a comprehensive title after the 'DOC: ' prefix>"
44
labels: [04 - Documentation]
55

66
body:

.github/ISSUE_TEMPLATE/feature-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Feature request
22
description: Check instructions for submitting your idea on the mailing list first.
3-
title: "ENH: "
3+
title: "ENH: <Please write a comprehensive title after the 'ENH: ' prefix>"
44

55
body:
66
- type: markdown

.github/ISSUE_TEMPLATE/post-install.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Post-install/importing issue
22
description: Report an issue if you have trouble importing or using NumPy after installation.
3+
title: "<Please write a comprehensive title here>"
34
labels: [32 - Installation]
45

56
body:
@@ -16,10 +17,12 @@ body:
1617
attributes:
1718
label: "Error message:"
1819
description: >
19-
Please include full error message, if any (starting from `Traceback: ...`).
20+
Please include full error message, if any.
2021
If you are reporting a segfault please include a GDB traceback,
2122
which you can generate by following
2223
[these instructions](https://github.com/numpy/numpy/blob/main/doc/source/dev/development_environment.rst#debugging).
24+
placeholder: |
25+
<< Full traceback starting from `Traceback: ...` >>
2326
render: shell
2427

2528
- type: textarea

.github/dependabot.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/build_test.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,82 @@ jobs:
230230
python-version: ${{ env.PYTHON_VERSION }}
231231
- uses: ./.github/actions
232232

233+
armv7_simd_test:
234+
needs: [smoke_test]
235+
runs-on: ubuntu-latest
236+
steps:
237+
- uses: actions/checkout@v2
238+
with:
239+
submodules: recursive
240+
fetch-depth: 0
241+
- name: Initialize binfmt_misc for qemu-user-static
242+
run: |
243+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
244+
- name: Creates new container
245+
run: |
246+
# use x86_64 cross-compiler to speed up the build
247+
sudo apt update
248+
sudo apt install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
249+
docker run --name the_container --interactive -v /:/host arm32v7/ubuntu:latest /bin/bash -c "
250+
apt update &&
251+
apt install -y git python3 python3-dev python3-pip &&
252+
pip3 install cython==0.29.24 setuptools\<49.2.0 hypothesis==6.23.3 pytest==6.2.5 &&
253+
ln -s /host/lib64 /lib64 &&
254+
ln -s /host/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu &&
255+
ln -s /host/usr/arm-linux-gnueabihf /usr/arm-linux-gnueabihf &&
256+
rm -rf /usr/lib/gcc/arm-linux-gnueabihf && ln -s /host/usr/lib/gcc-cross/arm-linux-gnueabihf /usr/lib/gcc/arm-linux-gnueabihf &&
257+
rm -f /usr/bin/arm-linux-gnueabihf-gcc && ln -s /host/usr/bin/arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc &&
258+
rm -f /usr/bin/arm-linux-gnueabihf-g++ && ln -s /host/usr/bin/arm-linux-gnueabihf-g++ /usr/bin/arm-linux-gnueabihf-g++ &&
259+
rm -f /usr/bin/arm-linux-gnueabihf-ar && ln -s /host/usr/bin/arm-linux-gnueabihf-ar /usr/bin/arm-linux-gnueabihf-ar &&
260+
rm -f /usr/bin/arm-linux-gnueabihf-as && ln -s /host/usr/bin/arm-linux-gnueabihf-as /usr/bin/arm-linux-gnueabihf-as &&
261+
rm -f /usr/bin/arm-linux-gnueabihf-ld && ln -s /host/usr/bin/arm-linux-gnueabihf-ld /usr/bin/arm-linux-gnueabihf-ld &&
262+
rm -f /usr/bin/arm-linux-gnueabihf-ld.bfd && ln -s /host/usr/bin/arm-linux-gnueabihf-ld.bfd /usr/bin/arm-linux-gnueabihf-ld.bfd
263+
"
264+
docker commit the_container the_container
265+
- name: Build
266+
run: |
267+
sudo docker run --name the_build --interactive -v $(pwd):/numpy -v /:/host the_container /bin/bash -c "
268+
uname -a &&
269+
gcc --version &&
270+
g++ --version &&
271+
python3 --version &&
272+
cd /numpy && python3 setup.py install
273+
"
274+
docker commit the_build the_build
275+
- name: Run SIMD Tests
276+
run: |
277+
docker run --rm --interactive -v $(pwd):/numpy the_build /bin/bash -c "
278+
cd /numpy && python3 runtests.py -n -v -- -k test_simd
279+
"
280+
281+
sde_simd_avx512_test:
282+
# Intel Software Development Emulator (SDE) is used to run a given program
283+
# on a specific instruction set architecture and capture various performance details.
284+
# see https://www.intel.com/content/www/us/en/developer/articles/tool/software-development-emulator.html
285+
needs: [smoke_test]
286+
runs-on: ubuntu-latest
287+
steps:
288+
- uses: actions/checkout@v2
289+
with:
290+
submodules: recursive
291+
fetch-depth: 0
292+
- uses: actions/setup-python@v2
293+
with:
294+
python-version: ${{ env.PYTHON_VERSION }}
295+
- name: Install Intel SDE
296+
run: |
297+
curl -o /tmp/sde.tar.bz2 https://www.intel.com/content/dam/develop/external/us/en/documents/downloads/sde-external-8.69.1-2021-07-18-lin.tar.bz2
298+
mkdir /tmp/sde && tar -xvf /tmp/sde.tar.bz2 -C /tmp/sde/
299+
sudo mv /tmp/sde/* /opt/sde && sudo ln -s /opt/sde/sde64 /usr/bin/sde
300+
- name: Install dependencies
301+
run: python -m pip install -r test_requirements.txt
302+
- name: Build
303+
run: python setup.py build
304+
--simd-test="\$werror AVX512F AVX512_KNL AVX512_KNM AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL"
305+
install
306+
# KNM implies KNL
307+
- name: Run SIMD tests (Xeon PHI)
308+
run: sde -knm -- python runtests.py -n -v -- -k test_simd
309+
# ICL implies SKX, CLX and CNL
310+
- name: Run SIMD tests (Ice Lake)
311+
run: sde -icl -- python runtests.py -n -v -- -k test_simd

.github/workflows/cygwin.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
python38-cython python38-pip python38-wheel python38-cffi
2525
python38-pytz python38-setuptools python38-pytest
2626
python38-hypothesis liblapack-devel libopenblas
27-
gcc-fortran git dash
27+
gcc-fortran gcc-g++ git dash
2828
- name: Set Windows PATH
2929
uses: egor-tensin/cleanup-path@v1
3030
with:
@@ -49,6 +49,9 @@ jobs:
4949
- name: Install new NumPy
5050
run: |
5151
bash -c "/usr/bin/python3.8 -m pip install dist/numpy-*cp38*.whl"
52+
- name: Rebase NumPy compiled extensions
53+
run: |
54+
dash "tools/rebase_installed_dlls_cygwin.sh" 3.8
5255
- name: Run NumPy test suite
5356
run: >-
5457
dash -c "/usr/bin/python3.8 runtests.py -n -vv"
@@ -64,4 +67,4 @@ jobs:
6467
dash -c "/usr/bin/python3.8 -m pip show numpy"
6568
dash -c "/usr/bin/python3.8 -m pip show -f numpy | grep .dll"
6669
dash -c "/bin/tr -d '\r' <tools/list_installed_dll_dependencies_cygwin.sh >list_dlls_unix.sh"
67-
dash "list_dlls_unix.sh"
70+
dash "list_dlls_unix.sh" 3.8

.github/workflows/wheels.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Workflow to build and test wheels.
2+
# To work on the wheel building infrastructure on a fork, comment out:
3+
#
4+
# if: github.repository == 'numpy/numpy'
5+
#
6+
# in the get_commit_message job. Be sure to include [cd build] in your commit
7+
# message to trigger the build. All files related to wheel building are located
8+
# at tools/wheels/
9+
name: Wheel builder
10+
11+
on:
12+
schedule:
13+
# Nightly build at 1:42 UTC
14+
- cron: "42 1 * * *"
15+
push:
16+
pull_request:
17+
workflow_dispatch:
18+
19+
jobs:
20+
get_commit_message:
21+
name: Get commit message
22+
runs-on: ubuntu-latest
23+
if: github.repository == 'numpy/numpy'
24+
outputs:
25+
message: ${{ steps.commit_message.outputs.message }}
26+
steps:
27+
- name: Checkout numpy
28+
uses: actions/checkout@v2
29+
# Gets the correct commit message for pull request
30+
with:
31+
ref: ${{ github.event.pull_request.head.sha }}
32+
- name: Get commit message
33+
id: commit_message
34+
run: |
35+
set -xe
36+
COMMIT_MSG=$(git log --no-merges -1 --oneline)
37+
echo "::set-output name=message::$COMMIT_MSG"
38+
39+
build_wheels:
40+
name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform }}
41+
needs: get_commit_message
42+
if: >-
43+
contains(needs.get_commit_message.outputs.message, '[wheel build]') ||
44+
github.event_name == 'schedule' ||
45+
github.event_name == 'workflow_dispatch'
46+
runs-on: ${{ matrix.os }}
47+
strategy:
48+
# Ensure that a wheel builder finishes even if another fails
49+
fail-fast: false
50+
matrix:
51+
include:
52+
# manylinux builds
53+
- os: ubuntu-latest
54+
python: "38"
55+
platform: manylinux_x86_64
56+
- os: ubuntu-latest
57+
python: "39"
58+
platform: manylinux_x86_64
59+
- os: ubuntu-latest
60+
python: "310"
61+
platform: manylinux_x86_64
62+
63+
# macos builds
64+
- os: macos-latest
65+
python: "38"
66+
platform: macosx_x86_64
67+
- os: macos-latest
68+
python: "39"
69+
platform: macosx_x86_64
70+
- os: macos-latest
71+
python: "310"
72+
platform: macosx_x86_64
73+
74+
steps:
75+
- name: Checkout numpy
76+
uses: actions/checkout@v2
77+
with:
78+
submodules: true
79+
# versioneer.py requires the latest tag to be reachable. Here we
80+
# fetch the complete history to get access to the tags.
81+
# A shallow clone can work when the following issue is resolved:
82+
# https://github.com/actions/checkout/issues/338
83+
fetch-depth: 0
84+
85+
- name: Build wheels
86+
uses: pypa/[email protected]
87+
env:
88+
NPY_USE_BLAS_ILP64: 1
89+
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform }}
90+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
91+
CIBW_ENVIRONMENT_LINUX: CFLAGS='-std=c99 -fno-strict-aliasing'
92+
LDFLAGS='-Wl,--strip-debug'
93+
OPENBLAS64_=/usr/local
94+
# MACOS linker doesn't support stripping symbols
95+
CIBW_ENVIRONMENT_MACOS: CFLAGS='-std=c99 -fno-strict-aliasing'
96+
OPENBLAS64_=/usr/local
97+
CIBW_BUILD_VERBOSITY: 3
98+
CIBW_BEFORE_BUILD: bash {project}/tools/wheels/cibw_before_build.sh {project}
99+
CIBW_BEFORE_TEST: pip install -r {project}/test_requirements.txt
100+
CIBW_TEST_COMMAND: bash {project}/tools/wheels/cibw_test_command.sh {project}
101+
102+
- uses: actions/upload-artifact@v2
103+
with:
104+
path: ./wheelhouse/*.whl

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,4 @@ numpy/core/src/umath/loops_arithmetic.dispatch.c
221221
numpy/core/src/umath/loops_minmax.dispatch.c
222222
numpy/core/src/umath/loops_trigonometric.dispatch.c
223223
numpy/core/src/umath/loops_exponent_log.dispatch.c
224+
numpy/core/src/umath/loops_umath_fp.dispatch.c

0 commit comments

Comments
 (0)