lanl / lanl/ExactPack

ExactPack incompatible with numpy >= 2

Open
#11 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
43
Forks
24
PR merge metrics
No merged PRs in 30d

Description

ExactPack's requirements.txt gives the numpy requirement as numpy >= 1.13.3, but I get the following error when trying to run its tests:

$ pytest $(python3 -c 'import importlib.resources; print(import lib.resources.files("exactpack")')
...
______________ ERROR collecting venv/lib/python3.11/site-packages/exactpack/tests/test_riemann.py _______________
ImportError while importing test module '.../venv/lib/python3.11/site-packages/exactpack/tests/test_riemann.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/python/3.11/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
../venv/lib/python3.11/site-packages/exactpack/tests/test_riemann.py:11: in <module>
    from exactpack.solvers.riemann.ep_riemann import IGEOS_Solver, GenEOS_Solver, streakplot
../venv/lib/python3.11/site-packages/exactpack/solvers/riemann/__init__.py:256: in <module>
    from .ep_riemann import *
../venv/lib/python3.11/site-packages/exactpack/solvers/riemann/ep_riemann.py:8: in <module>
    import matplotlib.pyplot as plt
/opt/python/3.11/lib/python3.11/site-packages/matplotlib/__init__.py:161: in <module>
    from . import _api, _version, cbook, _docstring, rcsetup
/opt/python/3.11/lib/python3.11/site-packages/matplotlib/rcsetup.py:27: in <module>
    from matplotlib.colors import Colormap, is_color_like
/opt/python/3.11/lib/python3.11/site-packages/matplotlib/colors.py:57: in <module>
    from matplotlib import _api, _cm, cbook, scale
/opt/python/3.11/lib/python3.11/site-packages/matplotlib/scale.py:22: in <module>
    from matplotlib.ticker import (
/opt/python/3.11/lib/python3.11/site-packages/matplotlib/ticker.py:143: in <module>
    from matplotlib import transforms as mtransforms
/opt/python/3.11/lib/python3.11/site-packages/matplotlib/transforms.py:49: in <module>
    from matplotlib._path import (
E   ImportError: numpy.core.multiarray failed to import
------------------------------------------------ Captured stderr ------------------------------------------------

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.3.3 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

When I forced installation of numpy < 2, the tests ran as expected.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with requirements.txt and the failing test path exactpack/tests/test_riemann.py. Reproduce the import failure with the declared NumPy range, then verify the dependency constraint and run the ExactPack tests; done means the tests pass with a supported NumPy installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, numpy, python
Domain
testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.