Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mark display_psf_grid as deprecated #901

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mperrin
Copy link
Collaborator

@mperrin mperrin commented Aug 5, 2024

This addresses #887 by marking display_psf_grid as deprecated, using an astropy decorator for marking deprecation.

I'm not actually sure this is the best way to do this, and welcome suggestions if there's a better way. I see there's also a PEP 702 to add a similar @deprecated to the standard library but it's not yet available even in py 3.12, so that doesn't work. In any case we can informally deprecate (and I'm separately revising the docs and example code in #899 already), so this PR is just attempting to mark the deprecation in code, in some suitable manner.

@pep8speaks
Copy link

pep8speaks commented Aug 5, 2024

Hello @mperrin, Thank you for updating !

There are no PEP8 issues in this Pull Request.

Comment last updated at 2024-08-05 17:57:23 UTC

@mperrin mperrin force-pushed the deprecate_display_psf_grid_fix887 branch from 9225b53 to 28d4368 Compare August 5, 2024 17:57
Copy link
Collaborator

@BradleySappington BradleySappington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mperrin - this is a working solution, however the warning looks like an astropy method is what is being deprecated. This may be confusing to the user (or it may not?)

I don't think we should included a deprecated library install for something like this, so we can either keep as you proposed, or just construct our own warning as so:

import warnings

warnings.simplefilter('always', DeprecationWarning)

def display_psf_grid((grid, zoom_in=True, figsize=(14, 12), scale_range=1e-4, diff_scale_range=1, cmap=None):

warnings.warn( "The display_psf_grid function is deprecated and may be removed in a future version." "Use photutils.psf.GriddedPSFModel.plot_grid instead.", DeprecationWarning, stacklevel=2 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants