Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numpy 2 deprecation warnings #4097

Closed
t20100 opened this issue Apr 3, 2024 · 1 comment · Fixed by #4100
Closed

numpy 2 deprecation warnings #4097

t20100 opened this issue Apr 3, 2024 · 1 comment · Fixed by #4100
Milestone

Comments

@t20100
Copy link
Member

t20100 commented Apr 3, 2024

Following #4082, those deprecation warnings are raised with numpy2 RC1:

gui/plot/test/testCurvesROIWidget.py: 14 warnings
  silx/gui/plot/CurvesROIWidget.py:1243: DeprecationWarning: `trapz` is deprecated. Use `trapezoid` instead, or one of the numerical integration functions in `scipy.integrate`.
    rawArea = numpy.trapz(y, x=x)

gui/plot/test/testCurvesROIWidget.py: 14 warnings
  silx/gui/plot/CurvesROIWidget.py:1249: DeprecationWarning: `trapz` is deprecated. Use `trapezoid` instead, or one of the numerical integration functions in `scipy.integrate`.
    background = numpy.trapz(yBackground, x=x)

gui/plot/test/testCurvesROIWidget.py::TestCurvesROIWidget::testAreaCalculation
  silx/gui/plot/test/testCurvesROIWidget.py:174: DeprecationWarning: `trapz` is deprecated. Use `trapezoid` instead, or one of the numerical integration functions in `scipy.integrate`.
    (numpy.trapz(y=[10, 20], x=[10, 20]), 0.0),

gui/plot/test/testPlotWidget.py::TestPlotScatter::testGridVisualization
gui/plot/test/testPlotWidget.py::TestPlotScatter::testGridVisualization
gui/plot/test/testPlotWidget.py::TestPlotScatter::testGridVisualization
gui/plot/test/testPlotWidget.py::TestPlotScatter::testGridVisualization
gui/plot/test/testPlotWidget.py::TestPlotScatter_Gl::testGridVisualization
gui/plot/test/testPlotWidget.py::TestPlotScatter_Gl::testGridVisualization
gui/plot/test/testPlotWidget.py::TestPlotScatter_Gl::testGridVisualization
gui/plot/test/testPlotWidget.py::TestPlotScatter_Gl::testGridVisualization
  silx/gui/plot/items/scatter.py:730: DeprecationWarning: Arrays of 2-dimensional vectors are deprecated. Use arrays of 3-dimensional vectors instead. (deprecated in NumPy 2.0)
    + numpy.cross(points[0, 1:] - points[0, :-1], (0.0, 0.0, 1.0))[

gui/plot/test/testPlotWidget.py::TestPlotScatter::testGridVisualization
gui/plot/test/testPlotWidget.py::TestPlotScatter::testGridVisualization
gui/plot/test/testPlotWidget.py::TestPlotScatter::testGridVisualization
gui/plot/test/testPlotWidget.py::TestPlotScatter::testGridVisualization
gui/plot/test/testPlotWidget.py::TestPlotScatter_Gl::testGridVisualization
gui/plot/test/testPlotWidget.py::TestPlotScatter_Gl::testGridVisualization
gui/plot/test/testPlotWidget.py::TestPlotScatter_Gl::testGridVisualization
gui/plot/test/testPlotWidget.py::TestPlotScatter_Gl::testGridVisualization
  silx/gui/plot/items/scatter.py:736: DeprecationWarning: Arrays of 2-dimensional vectors are deprecated. Use arrays of 3-dimensional vectors instead. (deprecated in NumPy 2.0)
    + numpy.cross(points[0, -1] - points[0, -2], (0.0, 0.0, 1.0))[

gui/plot/tools/test/testRoiItems.py::testArc_getToSetGeometry
  silx/gui/plot/items/_arc_roi.py:635: DeprecationWarning: Arrays of 2-dimensional vectors are deprecated. Use arrays of 3-dimensional vectors instead. (deprecated in NumPy 2.0)
    elif numpy.linalg.norm(numpy.cross(mid - start, end - start)) < 1e-5:

io/test/test_h5py_utils.py: 10 warnings
  multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=770) is multi-threaded, use of fork() may lead to deadlocks in the child.
    self.pid = os.fork()

opencl/sift/test/test_align.py::TestLinalign::test_align
opencl/sift/test/test_align.py::TestLinalign::test_align
  silx/opencl/sift/alignment.py:327: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    matrix[0, 0], matrix[0, 1] = transform_matrix[4], transform_matrix[3]

opencl/sift/test/test_align.py::TestLinalign::test_align
opencl/sift/test/test_align.py::TestLinalign::test_align
  silx/opencl/sift/alignment.py:328: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    matrix[1, 0], matrix[1, 1] = transform_matrix[1], transform_matrix[0]
@t20100 t20100 added this to the 2.1.0 milestone Apr 3, 2024
@t20100
Copy link
Member Author

t20100 commented Apr 4, 2024

See issue #4101 for:

io/test/test_h5py_utils.py: 10 warnings
  multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=770) is multi-threaded, use of fork() may lead to deadlocks in the child.
    self.pid = os.fork()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant