Skip to content

numpy for 2.x not compatible #2615

@ReimarBauer

Description

@ReimarBauer

I get always the same tests failing in parallel execution by

export QT_QPA_PLATFORM=offscreen
pytest -v -n auto --dist loadfile --cov=mslib

FAILED tests/_test_msui/test_topview.py::Test_MSSTopViewWindow::test_insert_point - assert 3 == 4
FAILED tests/_test_msui/test_topview.py::Test_MSSTopViewWindow::test_remove_point_yes - assert 3 == 4
FAILED tests/_test_msui/test_topview.py::Test_MSSTopViewWindow::test_remove_point_no - assert 3 == 4
FAILED tests/_test_msui/test_topview.py::Test_MSSTopViewWindow::test_move_point - assert 3 == 4
=================================== 4 failed, 561 passed, 20 skipped, 44 warnings in 313.90s (0:05:13) ====================================

We have to lookup how we can improve these tests. it looks like it is caused by the upgrade of numpy to 2.2.2

DEBUG [root] TopView insert point: clicked at (-6.313565, 1.468094), best index: 3
Traceback (most recent call last):
  File "/Users/reimarbauer/miniforge3/envs/mssdev/lib/python3.11/site-packages/matplotlib/cbook.py", line 298, in process
    func(*args, **kwargs)
  File "/Users/reimarbauer/PycharmProjects/MSS/mslib/msui/mpl_qtwidget.py", line 989, in _zoom_pan_handler
    self.canvas.waypoints_interactor.button_release_insert_callback(event)
  File "/Users/reimarbauer/PycharmProjects/MSS/mslib/msui/mpl_pathinteractor.py", line 1251, in button_release_insert_callback
    self.plotter.pathpatch.get_path().insert_vertex(best_index, [x, y], WaypointsPath.LINETO)
  File "/Users/reimarbauer/PycharmProjects/MSS/mslib/msui/mpl_pathinteractor.py", line 114, in insert_vertex
    np.asarray(vertex, np.float_), axis=0)
                       ^^^^^^^^^
  File "/Users/reimarbauer/miniforge3/envs/mssdev/lib/python3.11/site-packages/numpy/__init__.py", line 400, in __getattr__
    raise AttributeError(
AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.

Within the fix we have to pin numpy for the next major

There should be a pass through done to identify and fix similiar problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions