astropy / photutils

Astropy package for source detection and photometry. Maintainer: @larrybradley
https://photutils.readthedocs.io
BSD 3-Clause "New" or "Revised" License
233 stars 132 forks source link

find_peaks throws DeprecationWarning for __array_wrap__ when using numpy 2.0 #1697

Closed pllim closed 5 months ago

pllim commented 5 months ago

Example log: https://github.com/spacetelescope/acstools/actions/runs/7621726614/job/20758565731

acstools/findsat_mrt.py:783: in find_mrt_sources
    tbl = s.find_stars(snrmap, mask=snrmap_mask)
photutils/detection/starfinder.py:150: in find_stars
    cat = self._get_raw_catalog(data, mask=mask)
photutils/detection/starfinder.py:103: in _get_raw_catalog
    xypos = self._find_stars(convolved_data, kernel, self.threshold,
...
        if not exclude_border:
>           xpos -= xpad
E           DeprecationWarning: __array_wrap__ must accept context and return_scalar arguments (positionally) in the future. (Deprecated NumPy 2.0)

photutils/detection/core.py:120: DeprecationWarning

Caused by: https://github.com/numpy/numpy/pull/25409

Related: https://github.com/astropy/astropy/issues/15924

larrybradley commented 5 months ago

This needs to be fixed upstream in astropy. https://github.com/astropy/astropy/pull/15925 should fix it.

larrybradley commented 5 months ago

@pllim Is this still an issue?

pllim commented 5 months ago

Maybe not. Thanks for the ping!