Commit 5ce1939
fix(__array__): coerce to numpy + accept copy kwarg (numpy 2.x strict mode)
NumPy >=1.26 raises "object __array__ method not producing an array"
when __array__ returns a non-np.ndarray. Our impl returned self._array
directly, but _array can be a jax.Array on the JAX path (e.g. set by
`_array = jnp.where(...)` in __setitem__). Coerce to numpy via
np.asarray to satisfy the protocol contract.
Also added the `copy` kwarg introduced in numpy 2.0; without it, future
numpy may pass copy positionally and break the call.
Surfaced by python_matrix.yml smoke runs on autogalaxy_workspace, which
hit `np.array(vis.slim)` in autoarray/plot/utils.py:plot_visibilities_1d
on every Python version. Issue #74 in PyAutoBuild Category A.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 25a988d commit 5ce1939
1 file changed
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
425 | 435 | | |
426 | 436 | | |
427 | 437 | | |
| |||
0 commit comments