Skip to content

Numpy deprication in newest Python - "modulation_filters.py" #43

Open
@Hagtronics

Description

@Hagtronics

First of all - thanks for making this package available! :-)
Second of all - This is just FYI, I have fixed the issue for myself.

My Setup: Python 3.12, Numpy 1.26.2, Windows 10

Here is the error,

speechmetrics\absolute\srmr\modulation_filters.py", line 14, in make_modulation_filter
b = np.array([B0, 0, -B0], dtype=np.float)
^^^^^^^^

Here is the error description,

AttributeError: module 'numpy' has no attribute 'float'.
np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'cfloat'?

Error occurs in file: "modulation_filters.py" and functions,

"make_modulation_filter(w0, Q)", 2 places
"modfilt(F, x)", 1 place

Fix for me was: Replace "dtype=np.float" with "dtype=float" at 3 places in file: "modulation_filters.py".

-End-

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