Skip to content

Numpy trapz removal #1236

Description

@msujas

Problem with using trapz normalisation due to removal in Numpy in PyMCA PyPi release version - 5.9.4.

Image

From Numpy 2.4.0 release notes:

numpy.trapz — deprecated since NumPy 2.0 (2023-08-18). Use numpy.trapezoid or scipy.integrate functions instead.

In PyMCA get the following error when trying to normalise with this method:

PyMca5\PyMcaPlugins\NormalizationPlugins.py", line 238, in offsetAndArea
    y = y / numpy.trapz(y, x)
            ^^^^^^^^^^^
...

AttributeError: module 'numpy' has no attribute 'trapz'. Did you mean: 'trace'?

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions