Skip to content

Commit 3cda615

Browse files
authored
Merge branch 'main' into polynomial_single_datapoint
2 parents 5ba9e24 + 8cba529 commit 3cda615

File tree

628 files changed

+27803
-16972
lines changed

Some content is hidden

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

628 files changed

+27803
-16972
lines changed

.circleci/config.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
. venv/bin/activate
7575
cd doc
7676
# Don't use -q, show warning summary"
77-
SPHINXOPTS="-j2 -n" make -e html
77+
SPHINXOPTS="-W -n" make -e html
7878
if [[ $(find build/html -type f | wc -l) -lt 1000 ]]; then
7979
echo "doc build failed: build/html is empty"
8080
exit -1
@@ -85,7 +85,7 @@ jobs:
8585
command: |
8686
. venv/bin/activate
8787
cd doc/neps
88-
SPHINXOPTS="-j2 -n" make -e html || echo "ignoring errors for now"
88+
SPHINXOPTS="-n" make -e html || echo "ignoring errors for now"
8989
9090
- store_artifacts:
9191
path: doc/build/html/
@@ -95,14 +95,10 @@ jobs:
9595
# destination: neps
9696

9797
- run:
98-
name: run doctests on documentation
98+
name: run refguide-check
9999
command: |
100100
. venv/bin/activate
101-
# Note: keep these two checks separate, because they seem to
102-
# influence each other through changing global state (e.g., via
103-
# `np.polynomial.set_default_printstyle`)
104-
python tools/refguide_check.py --rst
105-
python tools/refguide_check.py --doctests
101+
python tools/refguide_check.py -v
106102
107103
- persist_to_workspace:
108104
root: ~/repo

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ body:
5656
label: "Runtime Environment:"
5757
description: |
5858
1. Install `threadpoolctl` (e.g. with `pip` or `conda`)
59-
2. Paste the output of `import numpy; print(numpy.show_runtime())`.
59+
2. Paste the output of `import numpy; numpy.show_runtime()`.
6060
6161
Note: Only valid for NumPy 1.24 or newer.
6262
validations:

.github/ISSUE_TEMPLATE/typing.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Static Typing
2+
description: Report an issue with the NumPy typing hints.
3+
title: "TYP: <Please write a comprehensive title after the 'TYP: ' prefix>"
4+
labels: [Static typing]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: >
10+
Thank you for taking the time to report this issue.
11+
Please make sure that this issue hasn't already been reported before.
12+
13+
- type: textarea
14+
attributes:
15+
label: "Describe the issue:"
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
attributes:
21+
label: "Reproduce the code example:"
22+
description: >
23+
A short code example that reproduces the error in your type-checker. It
24+
should be self-contained, i.e., can be run as-is via e.g.
25+
`mypy myproblem.py` or `pyright myproblem.py`.
26+
placeholder: |
27+
import numpy as np
28+
import numpy.typing as npt
29+
<< your code here >>
30+
render: python
31+
validations:
32+
required: true
33+
34+
- type: textarea
35+
attributes:
36+
label: "Error message:"
37+
description: >
38+
Please include all relevant error messages from your type-checker or IDE.
39+
render: shell
40+
41+
- type: textarea
42+
attributes:
43+
label: "Python and NumPy Versions:"
44+
description: >
45+
Output from `import sys, numpy; print(numpy.__version__); print(sys.version)`.
46+
validations:
47+
required: true
48+
49+
- type: textarea
50+
attributes:
51+
label: "Type-checker version and settings:"
52+
description: >
53+
Please include the exact version of the type-checker you are using.
54+
Popular (static) type checkers include Mypy, Pyright / Pylance, Pytype,
55+
Pyre, PyCharm, etc.
56+
Also include the full CLI command used to run the type-checker, and
57+
all of the relevant configuration options.
58+
validations:
59+
required: true
60+
61+
- type: textarea
62+
attributes:
63+
label: "Additional typing packages."
64+
description: |
65+
If you are using `typing-extensions` or typing-stub packages, please
66+
list their versions here.
67+
validations:
68+
required: false

.github/pr-prefix-labeler.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
"API": "30 - API"
22
"BENCH": "28 - Benchmark"
3-
"BUG": "00 - Bug"
43
"BLD": "36 - Build"
4+
"BUG": "00 - Bug"
55
"DEP": "07 - Deprecation"
66
"DEV": "16 - Development"
77
"DOC": "04 - Documentation"
88
"ENH": "01 - Enhancement"
99
"MAINT": "03 - Maintenance"
10+
"MNT": "03 - Maintenance"
11+
"REL": "14 - Release"
1012
"REV": "34 - Reversion"
1113
"STY": "03 - Maintenance"
1214
"TST": "05 - Testing"
13-
"REL": "14 - Release"
14-
"WIP": "25 - WIP"
1515
"TYP": "static typing"
16+
"WIP": "25 - WIP"

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
# Initializes the CodeQL tools for scanning.
4747
- name: Initialize CodeQL
48-
uses: github/codeql-action/init@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4
48+
uses: github/codeql-action/init@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2
4949
with:
5050
languages: ${{ matrix.language }}
5151
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -55,7 +55,7 @@ jobs:
5555
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5656
# If this step fails, then you should remove it and run the build manually (see below)
5757
- name: Autobuild
58-
uses: github/codeql-action/autobuild@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4
58+
uses: github/codeql-action/autobuild@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2
5959

6060
# ℹ️ Command-line programs to run using the OS shell.
6161
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -68,6 +68,6 @@ jobs:
6868
# ./location_of_script_within_repo/buildscript.sh
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4
71+
uses: github/codeql-action/analyze@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2
7272
with:
7373
category: "/language:${{matrix.language}}"

.github/workflows/cygwin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
cd tools
6363
/usr/bin/python3.9 -m pytest --pyargs numpy -n2 -m "not slow"
6464
- name: Upload wheel if tests fail
65-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
65+
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
6666
if: failure()
6767
with:
6868
name: numpy-cygwin-wheel

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
- name: 'Checkout Repository'
1818
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
1919
- name: 'Dependency Review'
20-
uses: actions/dependency-review-action@9129d7d40b8c12c1ed0f60400d00c92d437adcce # v4.1.3
20+
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4

.github/workflows/emscripten.yml

Lines changed: 39 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ on:
55
branches:
66
- main
77
- maintenance/**
8+
# Note: this workflow gets triggered on the same schedule as the
9+
# wheels.yml workflow to upload WASM wheels to Anaconda.org.
10+
schedule:
11+
# ┌───────────── minute (0 - 59)
12+
# │ ┌───────────── hour (0 - 23)
13+
# │ │ ┌───────────── day of the month (1 - 31)
14+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
15+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
16+
# │ │ │ │ │
17+
- cron: "42 2 * * SUN,WED"
18+
workflow_dispatch:
19+
inputs:
20+
push_wheels:
21+
# Can be 'true' or 'false'. Default is 'false'.
22+
# Warning: this will overwrite existing wheels.
23+
description: >
24+
Push wheels to Anaconda.org if the build succeeds
25+
required: false
26+
default: 'false'
827

928
env:
1029
FORCE_COLOR: 3
@@ -14,84 +33,39 @@ concurrency:
1433
cancel-in-progress: true
1534

1635
permissions:
17-
contents: read # to fetch code (actions/checkout)
36+
contents: read # to fetch code (actions/checkout)
1837

1938
jobs:
2039
build-wasm-emscripten:
2140
name: Build NumPy distribution for Pyodide
2241
runs-on: ubuntu-22.04
2342
# To enable this workflow on a fork, comment out:
2443
if: github.repository == 'numpy/numpy'
25-
env:
26-
PYODIDE_VERSION: 0.25.0
27-
# PYTHON_VERSION and EMSCRIPTEN_VERSION are determined by PYODIDE_VERSION.
28-
# The appropriate versions can be found in the Pyodide repodata.json
29-
# "info" field, or in Makefile.envs:
30-
# https://github.com/pyodide/pyodide/blob/main/Makefile.envs#L2
31-
PYTHON_VERSION: 3.11.3
32-
EMSCRIPTEN_VERSION: 3.1.46
33-
NODE_VERSION: 18
3444
steps:
3545
- name: Checkout NumPy
36-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
46+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3747
with:
3848
submodules: recursive
39-
# This input shall fetch tags without the need to fetch the
40-
# entire VCS history, see https://github.com/actions/checkout#usage
4149
fetch-tags: true
4250

43-
- name: Set up Python ${{ env.PYTHON_VERSION }}
44-
id: setup-python
45-
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
46-
with:
47-
python-version: ${{ env.PYTHON_VERSION }}
51+
- uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
52+
env:
53+
CIBW_PLATFORM: pyodide
4854

49-
- name: Set up Emscripten toolchain
50-
uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
55+
- name: Upload wheel artifact(s)
56+
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
5157
with:
52-
version: ${{ env.EMSCRIPTEN_VERSION }}
53-
actions-cache-folder: emsdk-cache
54-
55-
- name: Install pyodide-build
56-
run: pip install "pydantic<2" pyodide-build==${{ env.PYODIDE_VERSION }}
57-
58-
- name: Find installation for pyodide-build
59-
shell: python
60-
run: |
61-
import os
62-
import pyodide_build
63-
from pathlib import Path
64-
65-
pyodide_build_path = Path(pyodide_build.__file__).parent
66-
67-
env_file = os.getenv('GITHUB_ENV')
68-
69-
with open(env_file, "a") as myfile:
70-
myfile.write(f"PYODIDE_BUILD_PATH={pyodide_build_path}\n")
71-
72-
- name: Apply patch(es) for pyodide-build installation
73-
run: |
74-
ls -a ${{ env.PYODIDE_BUILD_PATH }}
75-
patch -d "${{ env.PYODIDE_BUILD_PATH }}" -p1 < tools/ci/emscripten/0001-do-not-set-meson-environment-variable-pyodide-gh-4502.patch
76-
77-
- name: Build NumPy for Pyodide
78-
run: |
79-
pyodide build -Cbuild-dir=build -Csetup-args="--cross-file=$PWD/tools/ci/emscripten/emscripten.meson.cross" -Csetup-args="-Dblas=none" -Csetup-args="-Dlapack=none"
80-
81-
- name: Set up Node.js
82-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
58+
name: cp312-pyodide_wasm32
59+
path: ./wheelhouse/*.whl
60+
61+
# Push to https://anaconda.org/scientific-python-nightly-wheels/numpy
62+
# WARNING: this job will overwrite any existing WASM wheels.
63+
- name: Push to Anaconda PyPI index
64+
if: >-
65+
(github.repository == 'numpy/numpy') &&
66+
(github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') ||
67+
(github.event_name == 'schedule')
68+
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0
8369
with:
84-
node-version: ${{ env.NODE_VERSION }}
85-
86-
- name: Set up Pyodide virtual environment
87-
run: |
88-
pyodide venv .venv-pyodide
89-
source .venv-pyodide/bin/activate
90-
pip install dist/*.whl
91-
pip install -r requirements/emscripten_test_requirements.txt
92-
93-
- name: Test NumPy for Pyodide
94-
run: |
95-
source .venv-pyodide/bin/activate
96-
cd ..
97-
pytest --pyargs numpy -m "not slow"
70+
artifacts_path: wheelhouse/
71+
anaconda_nightly_upload_token: ${{ secrets.NUMPY_NIGHTLY_UPLOAD_TOKEN }}

0 commit comments

Comments
 (0)