Bug 2333363 - pygrib needs to be rebuilt against NumPy 2.x
Summary: pygrib needs to be rebuilt against NumPy 2.x
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pygrib
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jos de Kloe
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: NUMPY2
TreeView+ depends on / blocked
 
Reported: 2024-12-19 16:39 UTC by Sandro
Modified: 2024-12-26 14:29 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-12-26 14:29:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github jswhit pygrib issues 261 0 None open Test failure with numpy 2.2.0 2024-12-25 17:40:26 UTC

Description Sandro 2024-12-19 16:39:26 UTC
Currently, importing pygrib results in:

>>> import pygrib
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import pygrib
  File "/usr/lib64/python3.13/site-packages/pygrib/__init__.py", line 2, in <module>
    from ._pygrib import *
  File "src/pygrib/_pygrib.pyx", line 1, in init pygrib._pygrib
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

A simple bump and rebuild should fix that.

Reproducible: Always

Comment 1 Orion Poplawski 2024-12-21 05:08:33 UTC
pygrib is failing to build with a test failure:

Trying:
    latsubset.min(),latsubset.max(),lonsubset.min(),lonsubset.max()
Expecting:
    (15.0, 65.0, 220.0, 320.0)
**********************************************************************
File "/home/orion/fedora/pygrib/pygrib-2.1.6-build/pygrib-f52c4cb4b10672f2400774524be01f45fbc004a2-tmp-test/test/test.py", line 207, in __main__.test
Failed example:
    latsubset.min(),latsubset.max(),lonsubset.min(),lonsubset.max()
Expected:
    (15.0, 65.0, 220.0, 320.0)
Got:
    (np.float64(15.0), np.float64(65.0), np.float64(220.0), np.float64(320.0))

I reported that upstream.

Comment 2 Sandro 2024-12-25 19:14:32 UTC
For now we can just revert to the old representation of scalars using `np.set_printoptions(legacy="1.25")` [1]. I've submitted PRs upstream and downstream.

[1] https://numpy.org/doc/2.2/release/2.0.0-notes.html#representation-of-numpy-scalars-changed


Note You need to log in before you can comment on or make changes to this bug.