Skip to content

Numpy compatibility issue#55

Open
skojaku wants to merge 3 commits intonicoloval:masterfrom
skojaku:numpy-compatibility-issue
Open

Numpy compatibility issue#55
skojaku wants to merge 3 commits intonicoloval:masterfrom
skojaku:numpy-compatibility-issue

Conversation

@skojaku
Copy link

@skojaku skojaku commented Sep 30, 2025

Issue

Nemtropy has a compatibility issue with numpy 2.0+ where np.infty has been removed from the API. See the following error messge:

    778     raise AttributeError(__former_attrs__[attr], name=None)
    780 if attr in __expired_attributes__:
--> 781     raise AttributeError(
    782         f"`np.{attr}` was removed in the NumPy 2.0 release. "
    783         f"{__expired_attributes__[attr]}",
    784         name=None
    785     )
    787 if attr == "chararray":
    788     warnings.warn(
    789         "`np.chararray` is deprecated and will be removed from "
    790         "the main namespace in the future. Use an array with a string "
    791         "or bytes dtype instead.", DeprecationWarning, stacklevel=2)

AttributeError: `np.infty` was removed in the NumPy 2.0 release. Use `np.inf` instead.

The code has been updated to use np.inf instead, which is the recommended replacement and maintains backward compatibility with earlier NumPy versions.

All instances of np.infty in the codebase have been replaced with np.inf.

@nicoloval nicoloval self-assigned this Oct 1, 2025
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 this pull request may close these issues.

3 participants

Comments