scipy 1.16.0rc1__cp313-cp313-win_amd64.whl → 1.16.1__cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. scipy/__config__.py +9 -9
  2. scipy/__init__.py +3 -3
  3. scipy/_cyutility.cp313-win_amd64.dll.a +0 -0
  4. scipy/_cyutility.cp313-win_amd64.pyd +0 -0
  5. scipy/_lib/_ccallback_c.cp313-win_amd64.dll.a +0 -0
  6. scipy/_lib/_ccallback_c.cp313-win_amd64.pyd +0 -0
  7. scipy/_lib/_fpumode.cp313-win_amd64.dll.a +0 -0
  8. scipy/_lib/_fpumode.cp313-win_amd64.pyd +0 -0
  9. scipy/_lib/_test_ccallback.cp313-win_amd64.dll.a +0 -0
  10. scipy/_lib/_test_ccallback.cp313-win_amd64.pyd +0 -0
  11. scipy/_lib/_test_deprecation_call.cp313-win_amd64.dll.a +0 -0
  12. scipy/_lib/_test_deprecation_call.cp313-win_amd64.pyd +0 -0
  13. scipy/_lib/_test_deprecation_def.cp313-win_amd64.dll.a +0 -0
  14. scipy/_lib/_test_deprecation_def.cp313-win_amd64.pyd +0 -0
  15. scipy/_lib/_uarray/_uarray.cp313-win_amd64.dll.a +0 -0
  16. scipy/_lib/_uarray/_uarray.cp313-win_amd64.pyd +0 -0
  17. scipy/_lib/_util.py +7 -0
  18. scipy/_lib/messagestream.cp313-win_amd64.dll.a +0 -0
  19. scipy/_lib/messagestream.cp313-win_amd64.pyd +0 -0
  20. scipy/cluster/_hierarchy.cp313-win_amd64.dll.a +0 -0
  21. scipy/cluster/_hierarchy.cp313-win_amd64.pyd +0 -0
  22. scipy/cluster/_optimal_leaf_ordering.cp313-win_amd64.dll.a +0 -0
  23. scipy/cluster/_optimal_leaf_ordering.cp313-win_amd64.pyd +0 -0
  24. scipy/cluster/_vq.cp313-win_amd64.dll.a +0 -0
  25. scipy/cluster/_vq.cp313-win_amd64.pyd +0 -0
  26. scipy/conftest.py +25 -0
  27. scipy/fft/_pocketfft/pypocketfft.cp313-win_amd64.dll.a +0 -0
  28. scipy/fft/_pocketfft/pypocketfft.cp313-win_amd64.pyd +0 -0
  29. scipy/fftpack/convolve.cp313-win_amd64.dll.a +0 -0
  30. scipy/fftpack/convolve.cp313-win_amd64.pyd +0 -0
  31. scipy/integrate/_dop.cp313-win_amd64.dll.a +0 -0
  32. scipy/integrate/_dop.cp313-win_amd64.pyd +0 -0
  33. scipy/integrate/_lsoda.cp313-win_amd64.dll.a +0 -0
  34. scipy/integrate/_lsoda.cp313-win_amd64.pyd +0 -0
  35. scipy/integrate/_odepack.cp313-win_amd64.dll.a +0 -0
  36. scipy/integrate/_odepack.cp313-win_amd64.pyd +0 -0
  37. scipy/integrate/_quadpack.cp313-win_amd64.dll.a +0 -0
  38. scipy/integrate/_quadpack.cp313-win_amd64.pyd +0 -0
  39. scipy/integrate/_test_multivariate.cp313-win_amd64.dll.a +0 -0
  40. scipy/integrate/_test_multivariate.cp313-win_amd64.pyd +0 -0
  41. scipy/integrate/_test_odeint_banded.cp313-win_amd64.dll.a +0 -0
  42. scipy/integrate/_test_odeint_banded.cp313-win_amd64.pyd +0 -0
  43. scipy/integrate/_vode.cp313-win_amd64.dll.a +0 -0
  44. scipy/integrate/_vode.cp313-win_amd64.pyd +0 -0
  45. scipy/interpolate/_dfitpack.cp313-win_amd64.dll.a +0 -0
  46. scipy/interpolate/_dfitpack.cp313-win_amd64.pyd +0 -0
  47. scipy/interpolate/_dierckx.cp313-win_amd64.dll.a +0 -0
  48. scipy/interpolate/_dierckx.cp313-win_amd64.pyd +0 -0
  49. scipy/interpolate/_fitpack.cp313-win_amd64.dll.a +0 -0
  50. scipy/interpolate/_fitpack.cp313-win_amd64.pyd +0 -0
  51. scipy/interpolate/_interpnd.cp313-win_amd64.dll.a +0 -0
  52. scipy/interpolate/_interpnd.cp313-win_amd64.pyd +0 -0
  53. scipy/interpolate/_ppoly.cp313-win_amd64.dll.a +0 -0
  54. scipy/interpolate/_ppoly.cp313-win_amd64.pyd +0 -0
  55. scipy/interpolate/_rbfinterp_pythran.cp313-win_amd64.dll.a +0 -0
  56. scipy/interpolate/_rbfinterp_pythran.cp313-win_amd64.pyd +0 -0
  57. scipy/interpolate/_rgi_cython.cp313-win_amd64.dll.a +0 -0
  58. scipy/interpolate/_rgi_cython.cp313-win_amd64.pyd +0 -0
  59. scipy/io/_fast_matrix_market/_fmm_core.cp313-win_amd64.dll.a +0 -0
  60. scipy/io/_fast_matrix_market/_fmm_core.cp313-win_amd64.pyd +0 -0
  61. scipy/io/_test_fortran.cp313-win_amd64.dll.a +0 -0
  62. scipy/io/_test_fortran.cp313-win_amd64.pyd +0 -0
  63. scipy/io/matlab/_mio5_utils.cp313-win_amd64.dll.a +0 -0
  64. scipy/io/matlab/_mio5_utils.cp313-win_amd64.pyd +0 -0
  65. scipy/io/matlab/_mio_utils.cp313-win_amd64.dll.a +0 -0
  66. scipy/io/matlab/_mio_utils.cp313-win_amd64.pyd +0 -0
  67. scipy/io/matlab/_streams.cp313-win_amd64.dll.a +0 -0
  68. scipy/io/matlab/_streams.cp313-win_amd64.pyd +0 -0
  69. scipy/io/matlab/tests/test_streams.py +9 -0
  70. scipy/linalg/_cythonized_array_utils.cp313-win_amd64.dll.a +0 -0
  71. scipy/linalg/_cythonized_array_utils.cp313-win_amd64.pyd +0 -0
  72. scipy/linalg/_decomp_interpolative.cp313-win_amd64.dll.a +0 -0
  73. scipy/linalg/_decomp_interpolative.cp313-win_amd64.pyd +0 -0
  74. scipy/linalg/_decomp_lu_cython.cp313-win_amd64.dll.a +0 -0
  75. scipy/linalg/_decomp_lu_cython.cp313-win_amd64.pyd +0 -0
  76. scipy/linalg/_decomp_update.cp313-win_amd64.dll.a +0 -0
  77. scipy/linalg/_decomp_update.cp313-win_amd64.pyd +0 -0
  78. scipy/linalg/_fblas.cp313-win_amd64.dll.a +0 -0
  79. scipy/linalg/_fblas.cp313-win_amd64.pyd +0 -0
  80. scipy/linalg/_flapack.cp313-win_amd64.dll.a +0 -0
  81. scipy/linalg/_flapack.cp313-win_amd64.pyd +0 -0
  82. scipy/linalg/_linalg_pythran.cp313-win_amd64.dll.a +0 -0
  83. scipy/linalg/_linalg_pythran.cp313-win_amd64.pyd +0 -0
  84. scipy/linalg/_matfuncs_expm.cp313-win_amd64.dll.a +0 -0
  85. scipy/linalg/_matfuncs_expm.cp313-win_amd64.pyd +0 -0
  86. scipy/linalg/_matfuncs_schur_sqrtm.cp313-win_amd64.dll.a +0 -0
  87. scipy/linalg/_matfuncs_schur_sqrtm.cp313-win_amd64.pyd +0 -0
  88. scipy/linalg/_matfuncs_sqrtm_triu.cp313-win_amd64.dll.a +0 -0
  89. scipy/linalg/_matfuncs_sqrtm_triu.cp313-win_amd64.pyd +0 -0
  90. scipy/linalg/_solve_toeplitz.cp313-win_amd64.dll.a +0 -0
  91. scipy/linalg/_solve_toeplitz.cp313-win_amd64.pyd +0 -0
  92. scipy/linalg/blas.py +35 -24
  93. scipy/linalg/cython_blas.cp313-win_amd64.dll.a +0 -0
  94. scipy/linalg/cython_blas.cp313-win_amd64.pyd +0 -0
  95. scipy/linalg/cython_lapack.cp313-win_amd64.dll.a +0 -0
  96. scipy/linalg/cython_lapack.cp313-win_amd64.pyd +0 -0
  97. scipy/linalg/tests/test_matfuncs.py +7 -0
  98. scipy/ndimage/_ctest.cp313-win_amd64.dll.a +0 -0
  99. scipy/ndimage/_ctest.cp313-win_amd64.pyd +0 -0
  100. scipy/ndimage/_cytest.cp313-win_amd64.dll.a +0 -0
  101. scipy/ndimage/_cytest.cp313-win_amd64.pyd +0 -0
  102. scipy/ndimage/_filters.py +52 -23
  103. scipy/ndimage/_nd_image.cp313-win_amd64.dll.a +0 -0
  104. scipy/ndimage/_nd_image.cp313-win_amd64.pyd +0 -0
  105. scipy/ndimage/_ni_label.cp313-win_amd64.dll.a +0 -0
  106. scipy/ndimage/_ni_label.cp313-win_amd64.pyd +0 -0
  107. scipy/ndimage/_rank_filter_1d.cp313-win_amd64.dll.a +0 -0
  108. scipy/ndimage/_rank_filter_1d.cp313-win_amd64.pyd +0 -0
  109. scipy/ndimage/tests/test_filters.py +94 -9
  110. scipy/odr/__odrpack.cp313-win_amd64.dll.a +0 -0
  111. scipy/odr/__odrpack.cp313-win_amd64.pyd +0 -0
  112. scipy/optimize/_bglu_dense.cp313-win_amd64.dll.a +0 -0
  113. scipy/optimize/_bglu_dense.cp313-win_amd64.pyd +0 -0
  114. scipy/optimize/_direct.cp313-win_amd64.dll.a +0 -0
  115. scipy/optimize/_direct.cp313-win_amd64.pyd +0 -0
  116. scipy/optimize/_group_columns.cp313-win_amd64.dll.a +0 -0
  117. scipy/optimize/_group_columns.cp313-win_amd64.pyd +0 -0
  118. scipy/optimize/_highspy/_core.cp313-win_amd64.dll.a +0 -0
  119. scipy/optimize/_highspy/_core.cp313-win_amd64.pyd +0 -0
  120. scipy/optimize/_highspy/_highs_options.cp313-win_amd64.dll.a +0 -0
  121. scipy/optimize/_highspy/_highs_options.cp313-win_amd64.pyd +0 -0
  122. scipy/optimize/_lbfgsb.cp313-win_amd64.dll.a +0 -0
  123. scipy/optimize/_lbfgsb.cp313-win_amd64.pyd +0 -0
  124. scipy/optimize/_lbfgsb_py.py +23 -8
  125. scipy/optimize/_lsap.cp313-win_amd64.dll.a +0 -0
  126. scipy/optimize/_lsap.cp313-win_amd64.pyd +0 -0
  127. scipy/optimize/_lsq/givens_elimination.cp313-win_amd64.dll.a +0 -0
  128. scipy/optimize/_lsq/givens_elimination.cp313-win_amd64.pyd +0 -0
  129. scipy/optimize/_lsq/least_squares.py +2 -2
  130. scipy/optimize/_minimize.py +0 -1
  131. scipy/optimize/_minpack.cp313-win_amd64.dll.a +0 -0
  132. scipy/optimize/_minpack.cp313-win_amd64.pyd +0 -0
  133. scipy/optimize/_moduleTNC.cp313-win_amd64.dll.a +0 -0
  134. scipy/optimize/_moduleTNC.cp313-win_amd64.pyd +0 -0
  135. scipy/optimize/_pava_pybind.cp313-win_amd64.dll.a +0 -0
  136. scipy/optimize/_pava_pybind.cp313-win_amd64.pyd +0 -0
  137. scipy/optimize/_shgo_lib/_complex.py +2 -2
  138. scipy/optimize/_slsqplib.cp313-win_amd64.dll.a +0 -0
  139. scipy/optimize/_slsqplib.cp313-win_amd64.pyd +0 -0
  140. scipy/optimize/_trlib/_trlib.cp313-win_amd64.dll.a +0 -0
  141. scipy/optimize/_trlib/_trlib.cp313-win_amd64.pyd +0 -0
  142. scipy/optimize/_zeros.cp313-win_amd64.dll.a +0 -0
  143. scipy/optimize/_zeros.cp313-win_amd64.pyd +0 -0
  144. scipy/optimize/cython_optimize/_zeros.cp313-win_amd64.dll.a +0 -0
  145. scipy/optimize/cython_optimize/_zeros.cp313-win_amd64.pyd +0 -0
  146. scipy/optimize/tests/test_lsq_linear.py +1 -1
  147. scipy/optimize/tests/test_optimize.py +3 -3
  148. scipy/signal/_filter_design.py +13 -1
  149. scipy/signal/_fir_filter_design.py +1 -1
  150. scipy/signal/_max_len_seq_inner.cp313-win_amd64.dll.a +0 -0
  151. scipy/signal/_max_len_seq_inner.cp313-win_amd64.pyd +0 -0
  152. scipy/signal/_peak_finding_utils.cp313-win_amd64.dll.a +0 -0
  153. scipy/signal/_peak_finding_utils.cp313-win_amd64.pyd +0 -0
  154. scipy/signal/_polyutils.py +1 -1
  155. scipy/signal/_sigtools.cp313-win_amd64.dll.a +0 -0
  156. scipy/signal/_sigtools.cp313-win_amd64.pyd +0 -0
  157. scipy/signal/_sosfilt.cp313-win_amd64.dll.a +0 -0
  158. scipy/signal/_sosfilt.cp313-win_amd64.pyd +0 -0
  159. scipy/signal/_spectral_py.py +9 -0
  160. scipy/signal/_spline.cp313-win_amd64.dll.a +0 -0
  161. scipy/signal/_spline.cp313-win_amd64.pyd +0 -0
  162. scipy/signal/_upfirdn_apply.cp313-win_amd64.dll.a +0 -0
  163. scipy/signal/_upfirdn_apply.cp313-win_amd64.pyd +0 -0
  164. scipy/signal/tests/test_filter_design.py +19 -0
  165. scipy/signal/tests/test_fir_filter_design.py +5 -0
  166. scipy/signal/tests/test_signaltools.py +1 -1
  167. scipy/signal/tests/test_spectral.py +31 -0
  168. scipy/sparse/_base.py +5 -2
  169. scipy/sparse/_csparsetools.cp313-win_amd64.dll.a +0 -0
  170. scipy/sparse/_csparsetools.cp313-win_amd64.pyd +0 -0
  171. scipy/sparse/_sparsetools.cp313-win_amd64.dll.a +0 -0
  172. scipy/sparse/_sparsetools.cp313-win_amd64.pyd +0 -0
  173. scipy/sparse/csgraph/_flow.cp313-win_amd64.dll.a +0 -0
  174. scipy/sparse/csgraph/_flow.cp313-win_amd64.pyd +0 -0
  175. scipy/sparse/csgraph/_matching.cp313-win_amd64.dll.a +0 -0
  176. scipy/sparse/csgraph/_matching.cp313-win_amd64.pyd +0 -0
  177. scipy/sparse/csgraph/_min_spanning_tree.cp313-win_amd64.dll.a +0 -0
  178. scipy/sparse/csgraph/_min_spanning_tree.cp313-win_amd64.pyd +0 -0
  179. scipy/sparse/csgraph/_reordering.cp313-win_amd64.dll.a +0 -0
  180. scipy/sparse/csgraph/_reordering.cp313-win_amd64.pyd +0 -0
  181. scipy/sparse/csgraph/_shortest_path.cp313-win_amd64.dll.a +0 -0
  182. scipy/sparse/csgraph/_shortest_path.cp313-win_amd64.pyd +0 -0
  183. scipy/sparse/csgraph/_tools.cp313-win_amd64.dll.a +0 -0
  184. scipy/sparse/csgraph/_tools.cp313-win_amd64.pyd +0 -0
  185. scipy/sparse/csgraph/_traversal.cp313-win_amd64.dll.a +0 -0
  186. scipy/sparse/csgraph/_traversal.cp313-win_amd64.pyd +0 -0
  187. scipy/sparse/linalg/_dsolve/_superlu.cp313-win_amd64.dll.a +0 -0
  188. scipy/sparse/linalg/_dsolve/_superlu.cp313-win_amd64.pyd +0 -0
  189. scipy/sparse/linalg/_eigen/arpack/_arpack.cp313-win_amd64.dll.a +0 -0
  190. scipy/sparse/linalg/_eigen/arpack/_arpack.cp313-win_amd64.pyd +0 -0
  191. scipy/sparse/linalg/_propack/_cpropack.cp313-win_amd64.dll.a +0 -0
  192. scipy/sparse/linalg/_propack/_cpropack.cp313-win_amd64.pyd +0 -0
  193. scipy/sparse/linalg/_propack/_dpropack.cp313-win_amd64.dll.a +0 -0
  194. scipy/sparse/linalg/_propack/_dpropack.cp313-win_amd64.pyd +0 -0
  195. scipy/sparse/linalg/_propack/_spropack.cp313-win_amd64.dll.a +0 -0
  196. scipy/sparse/linalg/_propack/_spropack.cp313-win_amd64.pyd +0 -0
  197. scipy/sparse/linalg/_propack/_zpropack.cp313-win_amd64.dll.a +0 -0
  198. scipy/sparse/linalg/_propack/_zpropack.cp313-win_amd64.pyd +0 -0
  199. scipy/sparse/tests/test_base.py +10 -0
  200. scipy/spatial/_ckdtree.cp313-win_amd64.dll.a +0 -0
  201. scipy/spatial/_ckdtree.cp313-win_amd64.pyd +0 -0
  202. scipy/spatial/_distance_pybind.cp313-win_amd64.dll.a +0 -0
  203. scipy/spatial/_distance_pybind.cp313-win_amd64.pyd +0 -0
  204. scipy/spatial/_distance_wrap.cp313-win_amd64.dll.a +0 -0
  205. scipy/spatial/_distance_wrap.cp313-win_amd64.pyd +0 -0
  206. scipy/spatial/_hausdorff.cp313-win_amd64.dll.a +0 -0
  207. scipy/spatial/_hausdorff.cp313-win_amd64.pyd +0 -0
  208. scipy/spatial/_qhull.cp313-win_amd64.dll.a +0 -0
  209. scipy/spatial/_qhull.cp313-win_amd64.pyd +0 -0
  210. scipy/spatial/_voronoi.cp313-win_amd64.dll.a +0 -0
  211. scipy/spatial/_voronoi.cp313-win_amd64.pyd +0 -0
  212. scipy/spatial/tests/test_distance.py +12 -0
  213. scipy/spatial/transform/_rigid_transform.cp313-win_amd64.dll.a +0 -0
  214. scipy/spatial/transform/_rigid_transform.cp313-win_amd64.pyd +0 -0
  215. scipy/spatial/transform/_rotation.cp313-win_amd64.dll.a +0 -0
  216. scipy/spatial/transform/_rotation.cp313-win_amd64.pyd +0 -0
  217. scipy/special/_comb.cp313-win_amd64.dll.a +0 -0
  218. scipy/special/_comb.cp313-win_amd64.pyd +0 -0
  219. scipy/special/_ellip_harm_2.cp313-win_amd64.dll.a +0 -0
  220. scipy/special/_ellip_harm_2.cp313-win_amd64.pyd +0 -0
  221. scipy/special/_gufuncs.cp313-win_amd64.dll.a +0 -0
  222. scipy/special/_gufuncs.cp313-win_amd64.pyd +0 -0
  223. scipy/special/_specfun.cp313-win_amd64.dll.a +0 -0
  224. scipy/special/_specfun.cp313-win_amd64.pyd +0 -0
  225. scipy/special/_special_ufuncs.cp313-win_amd64.dll.a +0 -0
  226. scipy/special/_special_ufuncs.cp313-win_amd64.pyd +0 -0
  227. scipy/special/_test_internal.cp313-win_amd64.dll.a +0 -0
  228. scipy/special/_test_internal.cp313-win_amd64.pyd +0 -0
  229. scipy/special/_ufuncs.cp313-win_amd64.dll.a +0 -0
  230. scipy/special/_ufuncs.cp313-win_amd64.pyd +0 -0
  231. scipy/special/_ufuncs_cxx.cp313-win_amd64.dll.a +0 -0
  232. scipy/special/_ufuncs_cxx.cp313-win_amd64.pyd +0 -0
  233. scipy/special/cython_special.cp313-win_amd64.dll.a +0 -0
  234. scipy/special/cython_special.cp313-win_amd64.pyd +0 -0
  235. scipy/stats/_ansari_swilk_statistics.cp313-win_amd64.dll.a +0 -0
  236. scipy/stats/_ansari_swilk_statistics.cp313-win_amd64.pyd +0 -0
  237. scipy/stats/_axis_nan_policy.py +1 -9
  238. scipy/stats/_biasedurn.cp313-win_amd64.dll.a +0 -0
  239. scipy/stats/_biasedurn.cp313-win_amd64.pyd +0 -0
  240. scipy/stats/_continuous_distns.py +19 -16
  241. scipy/stats/_correlation.py +1 -1
  242. scipy/stats/_distribution_infrastructure.py +20 -0
  243. scipy/stats/_entropy.py +2 -2
  244. scipy/stats/_hypotests.py +1 -1
  245. scipy/stats/_levy_stable/levyst.cp313-win_amd64.dll.a +0 -0
  246. scipy/stats/_levy_stable/levyst.cp313-win_amd64.pyd +0 -0
  247. scipy/stats/_morestats.py +7 -7
  248. scipy/stats/_qmc_cy.cp313-win_amd64.dll.a +0 -0
  249. scipy/stats/_qmc_cy.cp313-win_amd64.pyd +0 -0
  250. scipy/stats/_qmvnt_cy.cp313-win_amd64.dll.a +0 -0
  251. scipy/stats/_qmvnt_cy.cp313-win_amd64.pyd +0 -0
  252. scipy/stats/_rcont/rcont.cp313-win_amd64.dll.a +0 -0
  253. scipy/stats/_rcont/rcont.cp313-win_amd64.pyd +0 -0
  254. scipy/stats/_resampling.py +1 -1
  255. scipy/stats/_sobol.cp313-win_amd64.dll.a +0 -0
  256. scipy/stats/_sobol.cp313-win_amd64.pyd +0 -0
  257. scipy/stats/_stats.cp313-win_amd64.dll.a +0 -0
  258. scipy/stats/_stats.cp313-win_amd64.pyd +0 -0
  259. scipy/stats/_stats_mstats_common.py +4 -2
  260. scipy/stats/_stats_py.py +19 -19
  261. scipy/stats/_stats_pythran.cp313-win_amd64.dll.a +0 -0
  262. scipy/stats/_stats_pythran.cp313-win_amd64.pyd +0 -0
  263. scipy/stats/_unuran/unuran_wrapper.cp313-win_amd64.dll.a +0 -0
  264. scipy/stats/_unuran/unuran_wrapper.cp313-win_amd64.pyd +0 -0
  265. scipy/stats/_variation.py +1 -1
  266. scipy/stats/tests/test_distributions.py +13 -0
  267. scipy/stats/tests/test_fast_gen_inversion.py +2 -0
  268. scipy/stats/tests/test_morestats.py +4 -4
  269. scipy/version.py +2 -2
  270. scipy-1.16.1.dist-info/DELVEWHEEL +2 -0
  271. {scipy-1.16.0rc1.dist-info → scipy-1.16.1.dist-info}/LICENSE.txt +3 -3
  272. {scipy-1.16.0rc1.dist-info → scipy-1.16.1.dist-info}/METADATA +5 -4
  273. {scipy-1.16.0rc1.dist-info → scipy-1.16.1.dist-info}/RECORD +276 -276
  274. scipy-1.16.0rc1.dist-info/DELVEWHEEL +0 -2
  275. /scipy-1.16.0rc1-cp313-cp313-win_amd64.whl → /scipy-1.16.1-cp313-cp313-win_amd64.whl +0 -0
  276. {scipy-1.16.0rc1.dist-info → scipy-1.16.1.dist-info}/WHEEL +0 -0
  277. /scipy.libs/{libscipy_openblas-f07f5a5d207a3a47104dca54d6d0c86a.dll → libscipy_openblas-6b2103f2ae4d8547998b5d188e9801fb.dll} +0 -0
scipy/ndimage/_filters.py CHANGED
@@ -68,12 +68,23 @@ def _vectorized_filter_iv(input, function, size, footprint, output, mode, cval,
68
68
  if size is not None and footprint is not None:
69
69
  raise ValueError("Either `size` or `footprint` may be provided, not both.")
70
70
 
71
- # Either footprint or size must be provided, and these determine the core
72
- # dimensionality...
71
+ if axes is None:
72
+ axes = tuple(range(-input.ndim, 0))
73
+ elif np.isscalar(axes):
74
+ axes = (axes,)
75
+ n_axes = len(axes)
76
+ n_batch = input.ndim - n_axes
77
+
78
+ if n_axes > input.ndim:
79
+ message = ("The length of `axes` may not exceed the dimensionality of `input`"
80
+ "(`input.ndim`).")
81
+ raise ValueError(message)
82
+
83
+ # Either footprint or size must be provided
73
84
  footprinted_function = function
74
85
  if size is not None:
75
86
  # If provided, size must be an integer or tuple of integers.
76
- size = (size,)*input.ndim if np.isscalar(size) else tuple(size)
87
+ size = (size,)*n_axes if np.isscalar(size) else tuple(size)
77
88
  valid = [xp.isdtype(xp.asarray(i).dtype, 'integral') and i > 0 for i in size]
78
89
  if not all(valid):
79
90
  raise ValueError("All elements of `size` must be positive integers.")
@@ -84,13 +95,10 @@ def _vectorized_filter_iv(input, function, size, footprint, output, mode, cval,
84
95
  def footprinted_function(input, *args, axis=-1, **kwargs):
85
96
  return function(input[..., footprint], *args, axis=-1, **kwargs)
86
97
 
87
- n_axes = len(size)
88
- n_batch = input.ndim - n_axes
89
-
90
- # ...which can't exceed the dimensionality of `input`.
91
- if n_axes > input.ndim:
92
- message = ("The dimensionality of the window (`len(size)` or `footprint.ndim`) "
93
- "may not exceed the number of axes of `input` (`input.ndim`).")
98
+ # And by now, the dimensionality of the footprint must equal the number of axes
99
+ if n_axes != len(size):
100
+ message = ("`axes` must be compatible with the dimensionality "
101
+ "of the window specified by `size` or `footprint`.")
94
102
  raise ValueError(message)
95
103
 
96
104
  # If this is not *equal* to the dimensionality of `input`, then `axes`
@@ -101,9 +109,10 @@ def _vectorized_filter_iv(input, function, size, footprint, output, mode, cval,
101
109
  "(`len(size)` or `footprint.ndim`) does not equal the number "
102
110
  "of axes of `input` (`input.ndim`).")
103
111
  raise ValueError(message)
104
- axes = (axes,) if np.isscalar(axes) else axes
105
112
  else:
106
- axes = tuple(range(-n_axes, 0))
113
+ axes = tuple(range(-n_axes, 0)) if axes is None else axes
114
+
115
+ axes = (axes,) if np.isscalar(axes) else axes
107
116
 
108
117
  # If `origin` is provided, then it must be "broadcastable" to a tuple with length
109
118
  # equal to the core dimensionality.
@@ -150,10 +159,9 @@ def _vectorized_filter_iv(input, function, size, footprint, output, mode, cval,
150
159
 
151
160
  # For simplicity, work with `axes` at the end.
152
161
  working_axes = tuple(range(-n_axes, 0))
153
- if axes is not None:
154
- input = xp.moveaxis(input, axes, working_axes)
155
- output = (xp.moveaxis(output, axes, working_axes)
156
- if output is not None else output)
162
+ input = xp.moveaxis(input, axes, working_axes)
163
+ output = (xp.moveaxis(output, axes, working_axes)
164
+ if output is not None else output)
157
165
 
158
166
  # Wrap the function to limit maximum memory usage, deal with `footprint`,
159
167
  # and populate `output`. The latter requires some verbosity because we
@@ -190,8 +198,8 @@ def _vectorized_filter_iv(input, function, size, footprint, output, mode, cval,
190
198
  **kwargs)
191
199
  return output
192
200
 
193
- return (input, wrapped_function, size, mode, cval,
194
- origin, working_axes, n_axes, n_batch, xp)
201
+ return (input, wrapped_function, size, mode, cval, origin,
202
+ working_axes, axes, n_axes, n_batch, xp)
195
203
 
196
204
 
197
205
  @_ni_docstrings.docfiller
@@ -211,8 +219,22 @@ def vectorized_filter(input, function, *, size=None, footprint=None, output=None
211
219
 
212
220
  where ``axis`` specifies the axis (or axes) of ``window`` along which
213
221
  the filter function is evaluated.
214
- %(size_foot)s
215
- %(output)s
222
+ size : scalar or tuple, optional
223
+ See `footprint` below. Ignored if `footprint` is given.
224
+ footprint : array, optional
225
+ Either `size` or `footprint` must be defined. `size` gives
226
+ the shape that is taken from the input array, at every element
227
+ position, to define the input to the filter function.
228
+ `footprint` is a boolean array that specifies (implicitly) a
229
+ shape, but also which of the elements within this shape will get
230
+ passed to the filter function. Thus ``size=(n, m)`` is equivalent
231
+ to ``footprint=np.ones((n, m))``.
232
+ We adjust `size` to the number of dimensions indicated by `axes`.
233
+ For instance, if `axes` is ``(0, 2, 1)`` and ``n`` is passed for ``size``,
234
+ then the effective `size` is ``(n, n, n)``.
235
+ output : array, optional
236
+ The array in which to place the output. By default, an array of the dtype
237
+ returned by `function` will be created.
216
238
  mode : {'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional
217
239
  The `mode` parameter determines how the input array is extended
218
240
  beyond its boundaries. Default is 'reflect'. Behavior for each valid
@@ -409,7 +431,7 @@ def vectorized_filter(input, function, *, size=None, footprint=None, output=None
409
431
 
410
432
  """ # noqa: E501
411
433
 
412
- (input, function, size, mode, cval, origin, working_axes, n_axes, n_batch, xp
434
+ (input, function, size, mode, cval, origin, working_axes, axes, n_axes, n_batch, xp
413
435
  ) = _vectorized_filter_iv(input, function, size, footprint, output, mode, cval,
414
436
  origin, axes, batch_memory)
415
437
 
@@ -455,7 +477,7 @@ def vectorized_filter(input, function, *, size=None, footprint=None, output=None
455
477
  res = function(view)
456
478
 
457
479
  # move working_axes back to original positions
458
- return xp.moveaxis(res, working_axes, axes) if axes is not None else res
480
+ return xp.moveaxis(res, working_axes, axes)
459
481
 
460
482
 
461
483
  def _invalid_origin(origin, lenw):
@@ -1967,7 +1989,14 @@ def _rank_filter(input, rank, size=None, footprint=None, output=None,
1967
1989
  "A sequence of modes is not supported by non-separable rank "
1968
1990
  "filters")
1969
1991
  mode = _ni_support._extend_mode_to_code(mode, is_filter=True)
1970
- if input.ndim == 1:
1992
+ # Some corner cases are currently not allowed to use the
1993
+ # "new"/fast 1D rank filter code, including when the
1994
+ # footprint is large compared to the array size.
1995
+ # See discussion in gh-23293; longer-term it may be possible
1996
+ # to allow the fast path for these corner cases as well,
1997
+ # if algorithmic fixes are found.
1998
+ lim2 = input.size - ((footprint.size - 1) // 2 - origin)
1999
+ if input.ndim == 1 and ((lim2 >= 0) or (input.size == 1)):
1971
2000
  if input.dtype in (np.int64, np.float64, np.float32):
1972
2001
  x = input
1973
2002
  x_out = output
Binary file
Binary file
@@ -2571,7 +2571,7 @@ class TestThreading:
2571
2571
  for i in range(n):
2572
2572
  fun(*args, output=out[i, ...])
2573
2573
 
2574
- @xfail_xp_backends("cupy",
2574
+ @xfail_xp_backends("cupy",
2575
2575
  reason="XXX thread exception; cannot repro outside of pytest")
2576
2576
  def test_correlate1d(self, xp):
2577
2577
  d = np.random.randn(5000)
@@ -2585,7 +2585,7 @@ class TestThreading:
2585
2585
  self.check_func_thread(4, ndimage.correlate1d, (d, k), ot)
2586
2586
  xp_assert_equal(os, ot)
2587
2587
 
2588
- @xfail_xp_backends("cupy",
2588
+ @xfail_xp_backends("cupy",
2589
2589
  reason="XXX thread exception; cannot repro outside of pytest")
2590
2590
  def test_correlate(self, xp):
2591
2591
  d = xp.asarray(np.random.randn(500, 500))
@@ -2596,7 +2596,7 @@ class TestThreading:
2596
2596
  self.check_func_thread(4, ndimage.correlate, (d, k), ot)
2597
2597
  xp_assert_equal(os, ot)
2598
2598
 
2599
- @xfail_xp_backends("cupy",
2599
+ @xfail_xp_backends("cupy",
2600
2600
  reason="XXX thread exception; cannot repro outside of pytest")
2601
2601
  def test_median_filter(self, xp):
2602
2602
  d = xp.asarray(np.random.randn(500, 500))
@@ -2606,7 +2606,7 @@ class TestThreading:
2606
2606
  self.check_func_thread(4, ndimage.median_filter, (d, 3), ot)
2607
2607
  xp_assert_equal(os, ot)
2608
2608
 
2609
- @xfail_xp_backends("cupy",
2609
+ @xfail_xp_backends("cupy",
2610
2610
  reason="XXX thread exception; cannot repro outside of pytest")
2611
2611
  def test_uniform_filter1d(self, xp):
2612
2612
  d = np.random.randn(5000)
@@ -2619,7 +2619,7 @@ class TestThreading:
2619
2619
  self.check_func_thread(4, ndimage.uniform_filter1d, (d, 5), ot)
2620
2620
  xp_assert_equal(os, ot)
2621
2621
 
2622
- @xfail_xp_backends("cupy",
2622
+ @xfail_xp_backends("cupy",
2623
2623
  reason="XXX thread exception; cannot repro outside of pytest")
2624
2624
  def test_minmax_filter(self, xp):
2625
2625
  d = xp.asarray(np.random.randn(500, 500))
@@ -2908,15 +2908,19 @@ class TestVectorizedFilter:
2908
2908
  with pytest.raises(ValueError, match=message):
2909
2909
  ndimage.vectorized_filter(input, function, size=0)
2910
2910
 
2911
- message = "The dimensionality of the window"
2911
+ message = "The length of `axes` may not exceed "
2912
+ axes = (0, 1, 2)
2912
2913
  with pytest.raises(ValueError, match=message):
2913
- ndimage.vectorized_filter(input, function, size=(1, 2, 3))
2914
+ ndimage.vectorized_filter(input, function, size=(1, 2), axes=axes)
2914
2915
  with pytest.raises(ValueError, match=message):
2915
- ndimage.vectorized_filter(input, function, footprint=xp.ones((2, 2, 2)))
2916
+ ndimage.vectorized_filter(input, function, footprint=xp.ones((2, 2)),
2917
+ axes=axes)
2916
2918
 
2917
- message = "`axes` must be provided if the dimensionality..."
2919
+ message = "`axes` must be compatible with the dimensionality..."
2918
2920
  with pytest.raises(ValueError, match=message):
2919
2921
  ndimage.vectorized_filter(input, function, size=(1,))
2922
+ with pytest.raises(ValueError, match=message):
2923
+ ndimage.vectorized_filter(input, function, size=(2,), axes=(0,1))
2920
2924
 
2921
2925
  message = "All elements of `origin` must be integers"
2922
2926
  with pytest.raises(ValueError, match=message):
@@ -2986,6 +2990,35 @@ class TestVectorizedFilter:
2986
2990
  ref = ndimage.vectorized_filter(input, function, size=21)
2987
2991
  xp_assert_close(res, ref)
2988
2992
 
2993
+ def test_gh23046_feature(self, xp):
2994
+ # The intent of gh-23046 was to always allow `size` to be a scalar.
2995
+ rng = np.random.default_rng(45982734597824)
2996
+ img = xp.asarray(rng.random((5, 5)))
2997
+
2998
+ ref = ndimage.vectorized_filter(img, xp.mean, size=2)
2999
+ res = ndimage.vectorized_filter(img, xp.mean, size=2, axes=(0, 1))
3000
+ xp_assert_close(res, ref)
3001
+
3002
+ ref = ndimage.vectorized_filter(img, xp.mean, size=(2,), axes=(0,))
3003
+ res = ndimage.vectorized_filter(img, xp.mean, size=2, axes=0)
3004
+ xp_assert_close(res, ref)
3005
+
3006
+ def test_gh23046_fix(self, xp):
3007
+ # While investigating the feasibility of gh-23046, I noticed a bug when the
3008
+ # length of an `axes` tuple equals the dimensionality of the image.
3009
+ rng = np.random.default_rng(45982734597824)
3010
+ img = xp.asarray(rng.random((5, 5)))
3011
+ size = (2, 3)
3012
+ ref = ndimage.vectorized_filter(img.T, xp.mean, size=size).T
3013
+ res = ndimage.vectorized_filter(img, xp.mean, size=size, axes=(1, 0))
3014
+ xp_assert_close(res, ref)
3015
+
3016
+ ref = ndimage.vectorized_filter(img, xp.mean, size=size, mode='constant')
3017
+ res = ndimage.vectorized_filter(img, xp.mean, size=size[::-1], axes=(1, 0),
3018
+ mode='constant')
3019
+ xp_assert_close(res, ref)
3020
+
3021
+
2989
3022
 
2990
3023
  @given(x=npst.arrays(dtype=np.float64,
2991
3024
  shape=st.integers(min_value=1, max_value=1000)),
@@ -2996,3 +3029,55 @@ class TestVectorizedFilter:
2996
3029
  def test_gh_22586_crash_property(x, size, mode):
2997
3030
  # property-based test for median_filter resilience to hard crashing
2998
3031
  ndimage.median_filter(x, size=size, mode=mode)
3032
+
3033
+
3034
+ @pytest.mark.parametrize('samples, mode, size, expected', [
3035
+ ([1, 2], "reflect", 5, [2, 1]),
3036
+ ([2], "reflect", 5, [2]), # original failure from gh-23075
3037
+ ([2], "nearest", 5, [2]),
3038
+ ([2], "wrap", 5, [2]),
3039
+ ([2], "mirror", 5, [2]),
3040
+ ([2], "constant", 5, [0]),
3041
+ ([2], "reflect", 1, [2]),
3042
+ ([2], "nearest", 1, [2]),
3043
+ ([2], "wrap", 1, [2]),
3044
+ ([2], "mirror", 1, [2]),
3045
+ ([2], "constant", 1, [2]),
3046
+ ([2], "reflect", 100, [2]),
3047
+ ([2], "nearest", 100, [2]),
3048
+ ([2], "wrap", 100, [2]),
3049
+ ([2], "mirror", 100, [2]),
3050
+ ([2], "constant", 100, [0]),
3051
+ ])
3052
+ def test_gh_23075(samples, mode, size, expected):
3053
+ # results verified against SciPy 1.14.1, before the median_filter
3054
+ # overhaul
3055
+ sample_array = np.asarray(samples, dtype=np.float32)
3056
+ expected = np.asarray(expected, dtype=np.float32)
3057
+ filtered_samples = ndimage.median_filter(sample_array, size=size, mode=mode)
3058
+ xp_assert_close(filtered_samples, expected, check_shape=True, check_dtype=True)
3059
+
3060
+
3061
+ @pytest.mark.parametrize('samples, size, cval, expected', [
3062
+ ([2], 5, 17.7, [17.7]),
3063
+ ([2], 1, 0, [2]),
3064
+ ([2], 100, 1.4, [1.4]),
3065
+ ([9], 137, -7807.7, [-7807.7]),
3066
+ ])
3067
+ def test_gh_23075_constant(samples, size, cval, expected):
3068
+ # results verified against SciPy 1.14.1, before the median_filter
3069
+ # overhaul
3070
+ sample_array = np.asarray(samples, dtype=np.single)
3071
+ expected = np.asarray(expected, dtype=np.single)
3072
+ filtered_samples = ndimage.median_filter(sample_array,
3073
+ size=size,
3074
+ mode="constant",
3075
+ cval=cval)
3076
+ xp_assert_close(filtered_samples, expected, check_shape=True, check_dtype=True)
3077
+
3078
+
3079
+ def test_median_filter_lim2():
3080
+ sample_array = np.ones(8)
3081
+ expected = np.ones(8)
3082
+ filtered_samples = ndimage.median_filter(sample_array, size=19, mode="reflect")
3083
+ xp_assert_close(filtered_samples, expected, check_shape=True, check_dtype=True)
Binary file
Binary file
Binary file
Binary file
@@ -42,6 +42,8 @@ from ._optimize import (MemoizeJac, OptimizeResult, _call_callback_maybe_halt,
42
42
  from ._constraints import old_bound_to_new
43
43
 
44
44
  from scipy.sparse.linalg import LinearOperator
45
+ from scipy._lib.deprecation import _NoValue
46
+ import warnings
45
47
 
46
48
  __all__ = ['fmin_l_bfgs_b', 'LbfgsInvHessProduct']
47
49
 
@@ -93,7 +95,7 @@ def fmin_l_bfgs_b(func, x0, fprime=None, args=(),
93
95
  approx_grad=0,
94
96
  bounds=None, m=10, factr=1e7, pgtol=1e-5,
95
97
  epsilon=1e-8,
96
- iprint=-1, maxfun=15000, maxiter=15000, disp=None,
98
+ iprint=_NoValue, maxfun=15000, maxiter=15000, disp=_NoValue,
97
99
  callback=None, maxls=20):
98
100
  """
99
101
  Minimize a function func using the L-BFGS-B algorithm.
@@ -144,7 +146,7 @@ def fmin_l_bfgs_b(func, x0, fprime=None, args=(),
144
146
  output and this keyword has no function.
145
147
 
146
148
  .. deprecated:: 1.15.0
147
- This keyword is deprecated and will be removed from SciPy 1.17.0.
149
+ This keyword is deprecated and will be removed from SciPy 1.18.0.
148
150
 
149
151
  disp : int, optional
150
152
  Deprecated option that previously controlled the text printed on the
@@ -152,7 +154,7 @@ def fmin_l_bfgs_b(func, x0, fprime=None, args=(),
152
154
  output and this keyword has no function.
153
155
 
154
156
  .. deprecated:: 1.15.0
155
- This keyword is deprecated and will be removed from SciPy 1.17.0.
157
+ This keyword is deprecated and will be removed from SciPy 1.18.0.
156
158
 
157
159
  maxfun : int, optional
158
160
  Maximum number of function evaluations. Note that this function
@@ -265,7 +267,9 @@ def fmin_l_bfgs_b(func, x0, fprime=None, args=(),
265
267
 
266
268
  # build options
267
269
  callback = _wrap_callback(callback)
268
- opts = {'maxcor': m,
270
+ opts = {'disp': disp,
271
+ 'iprint': iprint,
272
+ 'maxcor': m,
269
273
  'ftol': factr * np.finfo(float).eps,
270
274
  'gtol': pgtol,
271
275
  'eps': epsilon,
@@ -288,9 +292,9 @@ def fmin_l_bfgs_b(func, x0, fprime=None, args=(),
288
292
 
289
293
 
290
294
  def _minimize_lbfgsb(fun, x0, args=(), jac=None, bounds=None,
291
- disp=None, maxcor=10, ftol=2.2204460492503131e-09,
295
+ disp=_NoValue, maxcor=10, ftol=2.2204460492503131e-09,
292
296
  gtol=1e-5, eps=1e-8, maxfun=15000, maxiter=15000,
293
- iprint=-1, callback=None, maxls=20,
297
+ iprint=_NoValue, callback=None, maxls=20,
294
298
  finite_diff_rel_step=None, workers=None,
295
299
  **unknown_options):
296
300
  """
@@ -305,7 +309,7 @@ def _minimize_lbfgsb(fun, x0, args=(), jac=None, bounds=None,
305
309
  output and this keyword has no function.
306
310
 
307
311
  .. deprecated:: 1.15.0
308
- This keyword is deprecated and will be removed from SciPy 1.17.0.
312
+ This keyword is deprecated and will be removed from SciPy 1.18.0.
309
313
 
310
314
  maxcor : int
311
315
  The maximum number of variable metric corrections used to
@@ -334,7 +338,7 @@ def _minimize_lbfgsb(fun, x0, args=(), jac=None, bounds=None,
334
338
  output and this keyword has no function.
335
339
 
336
340
  .. deprecated:: 1.15.0
337
- This keyword is deprecated and will be removed from SciPy 1.17.0.
341
+ This keyword is deprecated and will be removed from SciPy 1.18.0.
338
342
 
339
343
  maxls : int, optional
340
344
  Maximum number of line search steps (per iteration). Default is 20.
@@ -373,6 +377,17 @@ def _minimize_lbfgsb(fun, x0, args=(), jac=None, bounds=None,
373
377
 
374
378
  x0 = asarray(x0).ravel()
375
379
  n, = x0.shape
380
+ if disp is not _NoValue:
381
+ warnings.warn("scipy.optimize: The `disp` and `iprint` options of the "
382
+ "L-BFGS-B solver are deprecated and will be removed in "
383
+ "SciPy 1.18.0.",
384
+ DeprecationWarning, stacklevel=3)
385
+
386
+ if iprint is not _NoValue:
387
+ warnings.warn("scipy.optimize: The `disp` and `iprint` options of the "
388
+ "L-BFGS-B solver are deprecated and will be removed in "
389
+ "SciPy 1.18.0.",
390
+ DeprecationWarning, stacklevel=3)
376
391
 
377
392
  # historically old-style bounds were/are expected by lbfgsb.
378
393
  # That's still the case but we'll deal with new-style from here on,
Binary file
Binary file
@@ -17,7 +17,7 @@ from .trf import trf
17
17
  from .dogbox import dogbox
18
18
  from .common import EPS, in_bounds, make_strictly_feasible
19
19
 
20
-
20
+
21
21
  from scipy.optimize._optimize import _wrap_callback
22
22
 
23
23
  TERMINATION_MESSAGES = {
@@ -392,7 +392,7 @@ def least_squares(
392
392
 
393
393
  * For 'trf' : ``x_scale == 1``
394
394
  * For 'dogbox' : ``x_scale == 1``
395
- * For 'jac' : ``x_scale == 'jac'``
395
+ * For 'lm' : ``x_scale == 'jac'``
396
396
 
397
397
  .. versionchanged:: 1.16.0
398
398
  The default keyword value is changed from 1 to None to indicate that
@@ -188,7 +188,6 @@ def minimize(fun, x0, args=(), method=None, jac=None, hess=None,
188
188
 
189
189
  Equality constraint means that the constraint function result is to
190
190
  be zero whereas inequality means that it is to be non-negative.
191
- Note that COBYLA only supports inequality constraints.
192
191
 
193
192
  tol : float, optional
194
193
  Tolerance for termination. When `tol` is specified, the selected
Binary file
@@ -183,6 +183,7 @@ class Complex:
183
183
  self.V = VertexCacheIndex()
184
184
 
185
185
  self.V_non_symm = [] # List of non-symmetric vertices
186
+ self.split_edge = cache(self._split_edge)
186
187
 
187
188
  def __call__(self):
188
189
  return self.H
@@ -995,8 +996,7 @@ class Complex:
995
996
  d_v0v1.connect(d_v1v2)
996
997
  return
997
998
 
998
- @cache
999
- def split_edge(self, v1, v2):
999
+ def _split_edge(self, v1, v2):
1000
1000
  v1 = self.V[v1]
1001
1001
  v2 = self.V[v2]
1002
1002
  # Destroy original edge, if it exists:
Binary file
Binary file
@@ -239,7 +239,7 @@ class SparseMixin:
239
239
 
240
240
  # Default lsmr arguments should not fully converge the solution
241
241
  default_lsmr_sol = lsq_linear(A, b, lsq_solver='lsmr')
242
- with pytest.raises(AssertionError, match=""):
242
+ with pytest.raises(AssertionError):
243
243
  assert_allclose(exact_sol.x, default_lsmr_sol.x)
244
244
 
245
245
  # By increasing the maximum lsmr iters, it will converge
@@ -1126,7 +1126,7 @@ class TestOptimizeSimple(CheckOptimize):
1126
1126
 
1127
1127
  def test_minimize_l_bfgs_b(self):
1128
1128
  # Minimize with L-BFGS-B method
1129
- opts = {'disp': False, 'maxiter': self.maxiter}
1129
+ opts = {'maxiter': self.maxiter}
1130
1130
  r = optimize.minimize(self.func, self.startparams,
1131
1131
  method='L-BFGS-B', jac=self.grad,
1132
1132
  options=opts)
@@ -1156,7 +1156,7 @@ class TestOptimizeSimple(CheckOptimize):
1156
1156
  # Check that the `ftol` parameter in l_bfgs_b works as expected
1157
1157
  v0 = None
1158
1158
  for tol in [1e-1, 1e-4, 1e-7, 1e-10]:
1159
- opts = {'disp': False, 'maxiter': self.maxiter, 'ftol': tol}
1159
+ opts = {'maxiter': self.maxiter, 'ftol': tol}
1160
1160
  sol = optimize.minimize(self.func, self.startparams,
1161
1161
  method='L-BFGS-B', jac=self.grad,
1162
1162
  options=opts)
@@ -1173,7 +1173,7 @@ class TestOptimizeSimple(CheckOptimize):
1173
1173
  # check that the maxls is passed down to the Fortran routine
1174
1174
  sol = optimize.minimize(optimize.rosen, np.array([-1.2, 1.0]),
1175
1175
  method='L-BFGS-B', jac=optimize.rosen_der,
1176
- options={'disp': False, 'maxls': 1})
1176
+ options={'maxls': 1})
1177
1177
  assert not sol.success
1178
1178
 
1179
1179
  def test_minimize_l_bfgs_b_maxfun_interruption(self):
@@ -60,6 +60,17 @@ def _is_int_type(x):
60
60
  return True
61
61
 
62
62
 
63
+ def _real_dtype_for_complex(dtyp, *, xp):
64
+ if xp.isdtype(dtyp, 'real floating'):
65
+ return dtyp
66
+ if dtyp == xp.complex64:
67
+ return xp.float32
68
+ elif dtyp == xp.complex128:
69
+ return xp.float64
70
+ else:
71
+ raise ValueError(f"Unknown dtype {dtyp}.")
72
+
73
+
63
74
  # https://github.com/numpy/numpy/blob/v2.2.0/numpy/_core/function_base.py#L195-L302
64
75
  def _logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None, *, xp):
65
76
  if not isinstance(base, float | int) and xp.asarray(base).ndim > 0:
@@ -488,6 +499,7 @@ def freqz(b, a=1, worN=512, whole=False, plot=None, fs=2*pi,
488
499
  if xp.isdtype(a.dtype, 'integral'):
489
500
  a = xp.astype(a, xp_default_dtype(xp))
490
501
  res_dtype = xp.result_type(b, a)
502
+ real_dtype = _real_dtype_for_complex(res_dtype, xp=xp)
491
503
 
492
504
  b = xpx.atleast_nd(b, ndim=1, xp=xp)
493
505
  a = xpx.atleast_nd(a, ndim=1, xp=xp)
@@ -509,7 +521,7 @@ def freqz(b, a=1, worN=512, whole=False, plot=None, fs=2*pi,
509
521
  # if include_nyquist is true and whole is false, w should
510
522
  # include end point
511
523
  w = xp.linspace(0, lastpoint, N,
512
- endpoint=include_nyquist and not whole, dtype=res_dtype)
524
+ endpoint=include_nyquist and not whole, dtype=real_dtype)
513
525
  n_fft = N if whole else 2 * (N - 1) if include_nyquist else 2 * N
514
526
  if (xp_size(a) == 1 and (b.ndim == 1 or (b.shape[-1] == 1))
515
527
  and n_fft >= b.shape[0]
@@ -834,7 +834,7 @@ def remez(numtaps, bands, desired, *, weight=None, type='bandpass',
834
834
  xp = array_namespace(bands, desired, weight)
835
835
  bands = np.asarray(bands)
836
836
  desired = np.asarray(desired)
837
- if weight:
837
+ if weight is not None:
838
838
  weight = np.asarray(weight)
839
839
 
840
840
  fs = _validate_fs(fs, allow_none=True)
@@ -117,7 +117,7 @@ def poly(seq_of_zeros, *, xp):
117
117
  if xp.isdtype(a.dtype, 'complex floating'):
118
118
  # if complex roots are all complex conjugates, the roots are real.
119
119
  roots = xp.asarray(seq_of_zeros, dtype=xp.complex128)
120
- if xp.all(_sort_cmplx(roots, xp) == _sort_cmplx(xp.conj(roots), xp)):
120
+ if xp.all(xp.sort(xp.imag(roots)) == xp.sort(xp.imag(xp.conj(roots)))):
121
121
  a = xp.asarray(xp.real(a), copy=True)
122
122
 
123
123
  return a
Binary file
Binary file