Closed tylerjereddy closed 8 months ago
Ah, looks fixed on latest master
(I checked locally) after @ngoldbaum pointed out the fix, but not out in a stable release yet. Well, I do have 1 failure left when I use latest master
, but that may be from another prebuild dependency I think:
_____________________________________________________________________________________________________ TestPlotting.test_delaunay _____________________________________________________________________________________________________
[gw30] linux -- Python 3.11.2 /home/treddy/python_venvs/py_311_scipy_dev/bin/python
scipy/spatial/tests/test__plotutils.py:28: in test_delaunay
r = delaunay_plot_2d(obj, ax=fig.gca())
fig = <Figure size 640x480 with 1 Axes>
obj = <scipy.spatial._qhull.Delaunay object at 0x7f4069c8e090>
s_before = array([[3, 1, 0],
[2, 3, 0]], dtype=int32)
self = <scipy.spatial.tests.test__plotutils.TestPlotting object at 0x7f406fc45690>
sup = <numpy.testing._private.utils.suppress_warnings object at 0x7f406ae7ded0>
<decorator-gen-2>:2: in delaunay_plot_2d
???
ax = <Axes: >
tri = <scipy.spatial._qhull.Delaunay object at 0x7f4069c8e090>
scipy/spatial/_plotutils.py:20: in _held_figure
return func(obj, ax=ax, **kw)
ax = <Axes: >
func = <function delaunay_plot_2d at 0x7f4084c245e0>
kw = {}
obj = <scipy.spatial._qhull.Delaunay object at 0x7f4069c8e090>
plt = <module 'matplotlib.pyplot' from '/home/treddy/python_venvs/py_311_scipy_dev/lib/python3.11/site-packages/matplotlib/pyplot.py'>
was_held = True
scipy/spatial/_plotutils.py:86: in delaunay_plot_2d
ax.triplot(x, y, tri.simplices.copy())
ax = <Axes: >
tri = <scipy.spatial._qhull.Delaunay object at 0x7f4069c8e090>
x = array([0., 0., 1., 1.])
y = array([0., 1., 0., 1.])
/home/treddy/python_venvs/py_311_scipy_dev/lib/python3.11/site-packages/matplotlib/tri/_triplot.py:41: in triplot
x, y, edges = (tri.x, tri.y, tri.edges)
args = []
ax = <Axes: >
kwargs = {}
matplotlib = <module 'matplotlib' from '/home/treddy/python_venvs/py_311_scipy_dev/lib/python3.11/site-packages/matplotlib/__init__.py'>
tri = <matplotlib.tri._triangulation.Triangulation object at 0x7f4069c17710>
/home/treddy/python_venvs/py_311_scipy_dev/lib/python3.11/site-packages/matplotlib/tri/_triangulation.py:114: in edges
self._edges = self.get_cpp_triangulation().get_edges()
self = <matplotlib.tri._triangulation.Triangulation object at 0x7f4069c17710>
/home/treddy/python_venvs/py_311_scipy_dev/lib/python3.11/site-packages/matplotlib/tri/_triangulation.py:124: in get_cpp_triangulation
self._cpp_triangulation = _tri.Triangulation(
_tri = <module 'matplotlib._tri' from '/home/treddy/python_venvs/py_311_scipy_dev/lib/python3.11/site-packages/matplotlib/_tri.cpython-311-x86_64-linux-gnu.so'>
self = <matplotlib.tri._triangulation.Triangulation object at 0x7f4069c17710>
/home/treddy/python_venvs/py_311_scipy_dev/lib/python3.11/site-packages/numpy/core/multiarray.py:15: in __getattr__
_raise_warning(attr_name, "multiarray")
_raise_warning = <function _raise_warning at 0x7f408636db20>
attr_name = '_ARRAY_API'
multiarray = <module 'numpy._core.multiarray' from '/home/treddy/python_venvs/py_311_scipy_dev/lib/python3.11/site-packages/numpy/_core/multiarray.py'>
ret = <capsule object NULL at 0x7f408c795e60>
/home/treddy/python_venvs/py_311_scipy_dev/lib/python3.11/site-packages/numpy/core/_utils.py:10: in _raise_warning
warnings.warn(
E DeprecationWarning: numpy.core.multiarray is deprecated and has been renamed to numpy._core.multiarray. The numpy._core namespace contains private NumPy internals and its use is discouraged, as NumPy internals can change without warning in any release. In practice, most real-world usage of numpy.core is to access functionality in the public NumPy API. If that is the case, use the public NumPy API. If not, you are using NumPy internals. If you would still like to access an internal attribute, use numpy._core.multiarray._ARRAY_API.
attr = '_ARRAY_API'
new_module = 'numpy._core.multiarray'
old_module = 'numpy.core.multiarray'
submodule = 'multiarray'
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
2.11.1
Problem description
Using latest version of SciPy
main
along with latest version of NumPymain
I see 8402 failures in the Scipy testsuite that are a bit tricky, many of which seem to be related toinclude/pybind11/numpy.h
doingauto c = m.attr("_ARRAY_API");
and then aDeprecationWarning
boils up during the SciPy testsuite.I'll paste a full reproducer/traceback below (well, in the context of NumPy/SciPy
main
). I wonder if there is a simple way to suppress that particular warning in the header, since I thinkpybind11
is actually intending to dig into the internals there, given that there are already recent NumPy2.x
shims I see around in that file.Or maybe I'm just missing something completely here--@rgommers or @mtsokol can yell at me if so. I think this comes through in the
pybind11
bindings ofpocketfft
perhaps, based on the traceback.Reproducible example code