diff --git a/CHANGES.rst b/CHANGES.rst index d2be0b4ff..7586d91c2 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -72,6 +72,9 @@ API Changes - The PSF photometry ``finder_results`` attribute is now returned as a ``QTable`` instead of a list of ``QTable``. [#1704] + - Deprecated the ``NonNormalizable`` custom warning class in favor of + ``AstropyUserWarning``. [#1710] + - ``photutils.segmentation`` - The ``SourceCatalog`` ``get_label`` and ``get_labels`` methods now diff --git a/photutils/psf/models.py b/photutils/psf/models.py index 269bce442..6858b6978 100644 --- a/photutils/psf/models.py +++ b/photutils/psf/models.py @@ -8,7 +8,8 @@ import numpy as np from astropy.modeling import Fittable2DModel, Parameter -from astropy.utils.exceptions import AstropyWarning +from astropy.utils.decorators import deprecated +from astropy.utils.exceptions import AstropyUserWarning, AstropyWarning from photutils.aperture import CircularAperture from photutils.utils._parameters import as_pair @@ -17,6 +18,7 @@ 'IntegratedGaussianPRF', 'PRFAdapter'] +@deprecated('1.11.0', alternative='AstropyUserWarning') class NonNormalizable(AstropyWarning): """ Used to indicate that a :py:class:`FittableImageModel` model is @@ -229,7 +231,7 @@ def _compute_normalization(self, normalize=True): self._normalization_status = 1 warnings.warn('Overflow encountered while computing ' 'normalization constant. Normalization ' - 'constant will be set to 1.', NonNormalizable) + 'constant will be set to 1.', AstropyUserWarning) else: self._normalization_status = 2 @@ -572,7 +574,7 @@ def _compute_normalization(self, normalize=True): self._img_norm = 1 warnings.warn('Overflow encountered while computing ' 'normalization constant. Normalization ' - 'constant will be set to 1.', NonNormalizable) + 'constant will be set to 1.', AstropyUserWarning) else: self._normalization_status = 2