Skip to content

Commit

Permalink
Deprecate NonNormalizable
Browse files Browse the repository at this point in the history
  • Loading branch information
larrybradley committed Feb 16, 2024
1 parent f52a677 commit 4de6265
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions photutils/psf/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 4de6265

Please sign in to comment.