Skip to content

ptp() method is deprecated #32

@SterlingYM

Description

@SterlingYM

Hello, it looks like numpy has retired the ndarray.ptp() method and instead telling users to call np.ptp(array).
This change causes issues when running aesop with numpy>=2.0 (raises AttributeError: SpectralAxis instance has no attribute 'ptp'.)

Replacing wavelength.ptp().value with np.ptp(wavelength).value in lines like below seems to solve the issue.

spectrum.wavelength.ptp().value/4])

aesop/aesop/masking.py

Lines 45 to 46 in f2aa5a2

(spectrum.wavelength.ptp().value/8,
spectrum.wavelength.ptp().value/2)])[0]

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