Skip to content

Commit 689103d

Browse files
committed
Added support for NumPy 2.
The API function `numpy.product` was deprecated in NumPy 1.25 and removed in NumPy 2. It used to be just an alias for `numpy.prod`. Instead, we now alias it ourselves on import.
1 parent 2376105 commit 689103d

File tree

10 files changed

+8
-17
lines changed

10 files changed

+8
-17
lines changed

.github/workflows/publish_release.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ jobs:
1818

1919
- name: Install UV.
2020
uses: astral-sh/setup-uv@v5
21-
with:
22-
enable-cache: true
23-
cache-dependency-glob: "uv.lock"
2421

2522
- name: Build wheel.
2623
run: uv build --wheel

.github/workflows/test_commit.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
test:
88
strategy:
99
matrix:
10-
python: ["3.6", "3.11"]
10+
python: ["3.6", "3.13"]
1111
runs-on: ubuntu-20.04
1212
steps:
1313

@@ -21,9 +21,6 @@ jobs:
2121

2222
- name: Install UV.
2323
uses: astral-sh/setup-uv@v5
24-
with:
25-
enable-cache: true
26-
cache-dependency-glob: "uv.lock"
2724

2825
- name: Install package.
2926
run: uv sync

.github/workflows/test_monthly.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ jobs:
2020

2121
- name: Install UV.
2222
uses: astral-sh/setup-uv@v5
23-
with:
24-
enable-cache: true
25-
cache-dependency-glob: "uv.lock"
2623

2724
- name: Install package.
2825
run: uv sync

kde_diffusion/kde1d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from numpy import array, arange
88
from numpy import exp, sqrt, pi as π
99
from numpy import ceil, log2
10-
from numpy import product
10+
from numpy import prod as product
1111
from numpy import histogram
1212
from scipy.fft import dct, idct
1313
from scipy.optimize import brentq

kde_diffusion/kde2d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from numpy import exp, sqrt, pi as π
99
from numpy import ceil, log2
1010
from numpy import ones
11-
from numpy import product, outer
11+
from numpy import prod as product, outer
1212
from numpy import histogram2d
1313
from scipy.fft import dctn, idctn
1414
from scipy.optimize import brentq

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ readme = 'PyPI.md'
1919

2020
requires-python = '>= 3.6'
2121
dependencies = [
22-
'NumPy < 2',
22+
'NumPy',
2323
'SciPy',
2424
]
2525

verification/kde1d_refactored.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from numpy import arange
88
from numpy import exp, sqrt
99
from numpy import pi as π
10-
from numpy import product
10+
from numpy import prod as product
1111
from numpy import histogram
1212
from scipy.fft import dct, idct
1313
from scipy.optimize import brentq

verification/kde1d_reimplemented.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from numpy import zeros
1111
from numpy import real
1212
from numpy import hstack
13-
from numpy import product
13+
from numpy import prod as product
1414
from numpy import unique
1515
from numpy import histogram
1616
from numpy import isclose

verification/kde2d_refactored.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
########################################
77
from numpy import array, arange, ones
88
from numpy import exp, sqrt, pi as π
9-
from numpy import product, outer
9+
from numpy import prod as product, outer
1010
from numpy import histogram2d
1111
from numpy import isclose
1212
from scipy.fft import dctn, idctn

verification/kde2d_reimplemented.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from numpy import ones, zeros
1111
from numpy import real
1212
from numpy import vstack
13-
from numpy import product
13+
from numpy import prod as product
1414
from numpy import outer
1515
from numpy import histogram2d
1616
from numpy import repeat

0 commit comments

Comments
 (0)