Skip to content

product is deprecated as of NumPy 1.25.0 #996

Open

Description

@emanuel-schmid

Most of the warnings raised during tests are about product being deprecated as of Numpy 1.25.

Whithin climada, they are raised here:

warning module lineno
product is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use prod instead. climada.hazard.io 1149
product is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use prod instead. climada.hazard.io 1169
product is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use prod instead. climada.hazard.centroids.centr 1003
product is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use prod instead. climada.hazard.centroids.centr 1004
product is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use prod instead. climada.hazard.centroids.centr 1022
product is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use prod instead. climada.util.hdf5_handler 68
product is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use prod instead. climada.hazard.centroids.centr 1006
product is deprecated as of NumPy 1.25.0, and will be removed in NumPy 2.0. Please use prod instead. climada.hazard.centroids.centr 1007

The cause of this is h5py being restricted to <=3.8, because eccodes is pinned to 2.27.
It happens wherever np.array(obj) is called on a obj that is a h5py Store or Dataset.

The solution is to unpin eccodes, as requested in PR #947

Alternatively, all lines with np.array(obj) could be replaced by obj[:] (https://github.com/CLIMADA-project/climada_python/tree/feature/avoid_product_in_h5py)

Activity

  1. emanuel-schmid commented on Jan 31, 2025

    @emanuel-schmid
    CollaboratorAuthor

    Quite likely the Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation that is raised here:

    module lineno
    climada.util.hdf5_handler 92
    climada.util.finance 218
    climada.hazard.tc_tracks_synth 1052

    will also disappear with h5py > 3.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions