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

Update import path for GriddedPSFModel #696

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

bmorris3
Copy link
Contributor

Importing GriddedPSFModel directly from photutils without specifying the psf module has been deprecated since astropy/photutils#1433, which causes WebbPSF calls to warn:

webbpsf/gridded_library.py:108: DeprecationWarning: `photutils.GriddedPSFModel` is a 
deprecated alias for `photutils.psf.GriddedPSFModel` and will be removed in the future.
Instead, please use `from photutils.psf import GriddedPSFModel` to silence this warning.

This PR first tries to import GriddedPSFModel from the psf module, and falls back on old the top-level import if that fails. Failing both of these, the ImportError is raised.

Copy link
Collaborator

@obi-wan76 obi-wan76 left a comment

Choose a reason for hiding this comment

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

This looks good, thanks!

@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (b219a7d) 55.97% compared to head (af28236) 55.97%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #696   +/-   ##
========================================
  Coverage    55.97%   55.97%           
========================================
  Files           15       15           
  Lines         6280     6280           
========================================
  Hits          3515     3515           
  Misses        2765     2765           
Files Changed Coverage Δ
webbpsf/gridded_library.py 77.10% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@obi-wan76 obi-wan76 merged commit 290057a into spacetelescope:develop Jul 26, 2023
8 checks passed
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.

2 participants