Skip to content

Numpy bool deprecation causing errors #85

Description

@aaronkho

Summary

Running SAL with numpy>1.23.1 causes errors to be raised due to the deprecation of np.bool.

Steps to reproduce

Extraction of JPF signal: pl/hf-pellet_out_vol from JPF#92436, using sal==1.2.5, numpy==1.26.2

What is the current bug behavior?

Upon the attempted extraction, the following warning and error messages are given:

FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.
  bool: np.bool
AttributeError("module 'numpy' has no attribute 'bool'.\n`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.\nThe aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:\n    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations")

These cause Python to crash, ending any program which the SAL request was embedded within.

What is the expected correct behavior?

Even if the warning remains, the program should not crash.

Possible fixes

Advised to replace np.bool with the native Python bool type. So far only found in dataclass/core/scalar.py and dataclass/core/dictionary.py.

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

    BugIssues that report incorrect or undesirable behaviour(s)Priority: TriageTRIAGE: Yet to be prioritized.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions