CI: dev-deps job fails with NumPy main — `np.broadcast_arrays` now returns read-only views
Author: tschmCreated Sep 29, 2026Updated Oct 1, 2026
LabelsCI
The Linux tests / dev deps (py3.15) job, which builds against NumPy main (2.6.0.dev0), fails with 100 test failures on main: https://github.com/scipy/scipy/actions/runs/36559692192/job/109377336642
NumPy recently merged "ENH: Improve performance of np.broadcast_arrays and expire deprecation on writable views". np.broadcast_arrays now returns read-only views. Previously, writing to them only emitted a DeprecationWarning. SciPy writes to (or needs writable) broadcast results in two places:
scipy.statsUNU.RAN samplers (99 failures intest_fast_gen_inversion.py,test_sampling.py):ValueError: buffer source array is read-only. Whennp.all(cond),argsreduce(_distn_infrastructure.py) returns ravelledbroadcast_arraysviews. Theppf/ppf_hatmethods inunuran_wrapper.pyxthen bind them to a non-constdouble[::1]memoryview.scipy._lib._elementwise_iterative_method._initialize(1 failure,test_tanhsinh.py::test_improper_integrals):ValueError: assignment destination is read-only. The broadcast inputs are passed on to the user callable without a copy, and the test's callable modifiesxin place.
Possible fixes: use const double[::1] memoryviews in unuran_wrapper.pyx; copy after broadcasting in _initialize; optionally make argsreduce return writable arrays; audit other broadcast_arrays usages.
Source: scipy/scipy