Skip to content

Commit

Permalink
[SWE] Fix NumPy 2.0 compliance.
Browse files Browse the repository at this point in the history
Pyxu does not yet support v2.0, but we fix these issues now in anticipation of the release.

info: https://numpy.org/devdocs/numpy_2_0_migration_guide.html#numpy-2-0-migration-guide
  • Loading branch information
SepandKashani committed Mar 12, 2024
1 parent 4788548 commit 0f95712
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions dev/todo.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
NumPy 2.0 Migration
To be done when min supported version becomes 2.0:
pyxu.operator.interop.jax.py
xp.byte_bounds() -> xp.lib.array_utils.byte_bounds()

doc/
api/ has/is-being updated to ND API interactively.

Expand Down
2 changes: 1 addition & 1 deletion src/pyxu/math/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def bisect_cluster(
def _bisect(x_idx: np.ndarray) -> ClusterMapping:
# Split point cloud
_x = x[x_idx]
bbox_dim = _x.ptp(axis=0) / 2
bbox_dim = np.ptp(_x, axis=0) / 2
_clusters = grid_cluster(_x, bbox_dim)

# re-label output indices
Expand Down
4 changes: 2 additions & 2 deletions src/pyxu/operator/linop/fft/nufft.py
Original file line number Diff line number Diff line change
Expand Up @@ -1164,8 +1164,8 @@ def _partition_domain(
N, v_cl = len(v), {0: slice(None)}
if chunked and (M > 1) and (N > 1):
x_bbox_dim, v_bbox_dim = NUFFT3._infer_bbox_dims(
x_ptp=x.ptp(axis=0),
v_ptp=v.ptp(axis=0),
x_ptp=np.ptp(x, axis=0),
v_ptp=np.ptp(v, axis=0),
upsampfac=upsampfac,
domain=domain,
max_fft_mem=max_fft_mem,
Expand Down

0 comments on commit 0f95712

Please sign in to comment.