Skip to content

DeprecationWarning with NumPy>=1.25 (NumPy 2.x): array-to-scalar conversion in boiling_flow.py #19

Description

@burakatakan

Environment:

  • ht: 1.2.0
  • numpy: 2.2.6
  • scipy: 1.15.3
  • Python: 3.12.10
  • OS: Windows 10/11

When running code that triggers boiling flow correlations, ht emits repeated warnings:

DeprecationWarning: 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. (Deprecated NumPy 1.25.)

Location:
ht/boiling_flow.py:841

Example warning line:
S = (1 - exp(-FhlX0/kl))/(FhlX0/kl)

This happens many times in a simulation / test suite (thousands of warnings).
It would be great if ht could avoid passing ndarray objects into scalar math functions
or explicitly convert 0-d arrays via .item() / float(np.asarray(x).squeeze()).

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions