Skip to content

CyLP@0.94.0: Uses deprecated NumPy API np.float #227

@Hellseher

Description

@Hellseher

Hi,

I tried to refresh the package in Guix with NumPy 2.3.1 stack but noticed that some of the tests SEGFAULT a lot some of the functions depend on np.floag where NumPy mentioned it was removed in 1.20 in favor of float:

cylp/tests/test_CyClpSimplex.py::TestCyClpSimplex::test_MostFrequent Fatal Python error: Segmentation fault

Current thread 0x00007ffff7e6f740 (most recent call first):
  File "/tmp/guix-build-python-cylp-0.94.0.drv-0/source/cylp/tests/test_CyClpSimplex.py", line 43 in test_MostFrequent
  File "/gnu/store/klzq7vpf4fsklsn0bi3s569xhrqkq3h2-python-3.11.14/lib/python3.11/unittest/case.py", line 579 in _callTestMethod
  File "/gnu/store/klzq7vpf4fsklsn0bi3s569xhrqkq3h2-python-3.11.14/lib/python3.11/unittest/case.py", line 623 in run
  File "/gnu/store/klzq7vpf4fsklsn0bi3s569xhrqkq3h2-python-3.11.14/lib/python3.11/unittest/case.py", line 678 in __call__
  File "/gnu/store/lmicanak1gj32863g3agyvz6i6q4b6z0-python-pytest-8.4.1/lib/python3.11/site-packages/_pytest/unittest.py", line 351 in runtest
  File "/gnu/store/lmicanak1gj32863g3agyvz6i6q4b6z0-python-pytest-8.4.1/lib/python3.11/site-packages/_pytest/runner.py", line 178 in pytest_runtest_call
  File "/gnu/store/gjcr4x3vsavyhkm2873hnws2hgvvp1p0-python-pluggy-1.6.0/lib/python3.11/site-packages/pluggy/_callers.py", line 121 in _multicall
  File "/gnu/store/gjcr4x3vsavyhkm2873hnws2hgvvp1p0-python-pluggy-1.6.0/lib/python3.11/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/gnu/store/gjcr4x3vsavyhkm2873hnws2hgvvp1p0-python-pluggy-1.6.0/lib/python3.11/site-packages/pluggy/_hooks.py", line 512 in __call__
  File "/gnu/store/lmicanak1gj32863g3agyvz6i6q4b6z0-python-pytest-8.4.1/lib/python3.11/site-packages/_pytest/runner.py", line 246 in <lambda>
  File "/gnu/store/lmicanak1gj32863g3agyvz6i6q4b6z0-python-pytest-8.4.1/lib/python3.11/site-packages/_pytest/runner.py", line 344 in from_call
  File "/gnu/store/lmicanak1gj32863g3agyvz6i6q4b6z0-python-pytest-8.4.1/lib/python3.11/site-packages/_pytest/runner.py", line 245 in call_and_report
  File "/gnu/store/lmicanak1gj32863g3agyvz6i6q4b6z0-python-pytest-8.4.1/lib/python3.11/site-packages/_pytest/runner.py", line 136 in runtestprotocol
  File "/gnu/store/lmicanak1gj32863g3agyvz6i6q4b6z0-python-pytest-8.4.1/lib/python3.11/site-packages/_pytest/runner.py", line 117 in pytest_runtest_protocol
  File "/gnu/store/gjcr4x3vsavyhkm2873hnws2hgvvp1p0-python-pluggy-1.6.0/lib/python3.11/site-packages/pluggy/_callers.py", line 121 in _multicall
  File "/gnu/store/gjcr4x3vsavyhkm2873hnws2hgvvp1p0-python-pluggy-1.6.0/lib/python3.11/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/gnu/store/gjcr4x3vsavyhkm2873hnws2hgvvp1p0-python-pluggy-1.6.0/lib/python3.11/site-packages/pluggy/_hooks.py", line 512 in __call__
  File "/gnu/store/lmicanak1gj32863g3agyvz6i6q4b6z0-python-pytest-8.4.1/lib/python3.11/site-packages/_pytest/main.py", line 367 in pytest_runtestloop
  File "/gnu/store/gjcr4x3vsavyhkm2873hnws2hgvvp1p0-python-pluggy-1.6.0/lib/python3.11/site-packages/pluggy/_callers.py", line 121 in _multicall
  File "/gnu/store/gjcr4x3vsavyhkm2873hnws2hgvvp1p0-python-pluggy-1.6.0/lib/python3.11/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/gnu/store/gjcr4x3vsavyhkm2873hnws2hgvvp1p0-python-pluggy-1.6.0/lib/python3.11/site-packages/pluggy/_hooks.py", line 512 in __call__
  File "/gnu/store/lmicanak1gj32863g3agyvz6i6q4b6z0-python-pytest-8.4.1/lib/python3.11/site-packages/_pytest/main.py", line 343 in _main
  File "/gnu/store/lmicanak1gj32863g3agyvz6i6q4b6z0-python-pytest-8.4.1/lib/python3.11/site-packages/_pytest/main.py", line 289 in wrap_session
  File "/gnu/store/lmicanak1gj32863g3agyvz6i6q4b6z0-python-pytest-8.4.1/lib/python3.11/site-packages/_pytest/main.py", line 336 in pytest_cmdline_main
  File "/gnu/store/gjcr4x3vsavyhkm2873hnws2hgvvp1p0-python-pluggy-1.6.0/lib/python3.11/site-packages/pluggy/_callers.py", line 121 in _multicall
  File "/gnu/store/gjcr4x3vsavyhkm2873hnws2hgvvp1p0-python-pluggy-1.6.0/lib/python3.11/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/gnu/store/gjcr4x3vsavyhkm2873hnws2hgvvp1p0-python-pluggy-1.6.0/lib/python3.11/site-packages/pluggy/_hooks.py", line 512 in __call__
  File "/gnu/store/lmicanak1gj32863g3agyvz6i6q4b6z0-python-pytest-8.4.1/lib/python3.11/site-packages/_pytest/config/__init__.py", line 175 in main
  File "/gnu/store/lmicanak1gj32863g3agyvz6i6q4b6z0-python-pytest-8.4.1/lib/python3.11/site-packages/_pytest/config/__init__.py", line 201 in console_main
  File "/gnu/store/lmicanak1gj32863g3agyvz6i6q4b6z0-python-pytest-8.4.1/bin/.pytest-real", line 6 in <module>

Extension modules: numpy._core._multiarray_umath, numpy.linalg._umath_linalg, cylp.cy.CyCoinIndexedVector, cylp.cy.CyCoinModel, cylp.cy.CyCoinPackedMatrix, cylp.cy.CyCgl, cylp.cy.CyCbcNode, cython.cimports.libc.math, scipy._lib._ccallback_c, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._pcg64, numpy.random._mt19937, numpy.random._generator, numpy.random._philox, numpy.random._sfc64, numpy.random.mtrand, scipy.sparse._sparsetools, _csparsetools, _cyutility, scipy._cyutility, scipy.sparse._csparsetools, cylp.cy.CyOsiCuts, cylp.cy.CyCglTreeInfo, cylp.cy.CyCglCutGeneratorBase, cylp.cy.CyCutGeneratorPythonBase, cylp.cy.CyCbcModel, cylp.cy.CyOsiSolverInterface, cylp.cy.CyClpDualRowPivotBase, cylp.cy.CyClpPrimalColumnPivotBase, cylp.cy.CyWolfePivot, cylp.cy.CyPEPivot, cylp.cy.CyPivotPythonBase, cylp.cy.CyDualPivotPythonBase, cylp.cy.CyCoinMpsIO, cylp.cy.CyClpSimplex, cylp.cy.CyDantzigPivot, cylp.cy.CyTest (total: 39)
FAILED cylp/tests/test_sparseUtil.py::TestSpaseUtil::test_scale_scale - AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
FAILED cylp/tests/test_sparseUtil.py::TestSpaseUtil::test_scale_unscale - AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
================== 2 failed, 50 passed, 55 warnings in 0.88s ===================

Open issue on Guix tracker https://codeberg.org/guix/guix/issues/2912

Inputs
Python 3.11.14

  • pkg-config@0.29.2
  • python-cython@3.1.7
  • python-pytest@8.4.1
  • python-setuptools@80.9.0
  • cbc@2.10.5
  • python-numpy@2.3.1
  • python-scipy@1.16.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions