Skip to content

Updating for NumPy 2.0 #1588

@andrew-s28

Description

@andrew-s28

NumPy's first major version update in years has officially released, and if one follows the parcels installation tutorial they will find themselves with NumPy v2.0.0 installed by default.

The only breaking change that I could find for parcels is the use of np.infty, which has been deprecated in favor of np.inf in NumPy 2.0.0. I haven't found any other breaking changes, and with just the changing of np.infty->np.inf, the example python example_peninsula.py --fieldset 100 100 runs without error, but I haven't done any more testing than this.

I can submit a PR and get np.infty changed easily, and it is of course backwards compatible with the current NumPy and parcels versions. I just wanted to open this issue first to start a conversation and see if anyone can find any other breaking changes in NumPy 2.0.0 (especially the NumPy C API, since I'm not well versed in the C code generation used in parcels or if it relies on NumPy at all), or if this has been thought about by others yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions