-
Notifications
You must be signed in to change notification settings - Fork 187
Requre photutils 3+ #10471
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
Open
larrybradley
wants to merge
6
commits into
spacetelescope:main
Choose a base branch
from
larrybradley:photutils-future
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Requre photutils 3+ #10471
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d637ba0
Use context manager instead of global variable
larrybradley 2e860aa
Require photutils 3+; bump dependent versions
larrybradley 25bc5d6
Remove support for photutils 2.x
larrybradley 82fb4f2
Add changelog entry
larrybradley b60e3de
Update regtests
larrybradley 9704d47
Bump min version of packaging and scikit-image to prevent warnings
larrybradley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Numpy >= 2.0, Astropy >= 6.1.4, and Photutils >= 3.0 are now required. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| from pathlib import Path | ||
|
|
||
| import astropy.units as u | ||
| import numpy as np | ||
| import pytest | ||
| import stdatamodels.jwst.datamodels as dm | ||
|
|
@@ -63,7 +64,10 @@ def test_source_catalog(nircam_model, npixels, nsources): | |
| assert np.isclose(cat["isophotal_abmag"][1], 19.150, atol=0.001) | ||
| assert np.isclose(cat["semimajor_sigma"][1].value, 18.844, atol=0.001) | ||
| assert np.isclose(cat["semiminor_sigma"][1].value, 7.025, atol=0.001) | ||
| assert np.isclose(cat["ellipticity"][1].value, 0.627, atol=0.001) | ||
| ellipticity = cat["ellipticity"][1] | ||
| if isinstance(ellipticity, u.Quantity): | ||
| ellipticity = ellipticity.value | ||
|
Comment on lines
+68
to
+69
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is an if...else necessary here? Shouldn't it always be one or the other, a Quantity or not? |
||
| assert np.isclose(ellipticity, 0.627, atol=0.001) | ||
| assert np.isclose(cat["orientation"][1].value, -72.783, atol=0.001) or np.isclose( | ||
| cat["orientation"][1].value, 287.217, atol=0.001 | ||
| ) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,10 +3,8 @@ | |
|
|
||
| import asdf | ||
| import numpy as np | ||
| import photutils | ||
| import pytest | ||
| from astropy.table import QTable, Table | ||
| from astropy.utils import minversion | ||
| from astropy.utils.data import get_pkg_data_filename | ||
| from astropy.wcs import WCS | ||
| from gwcs.wcstools import grid_from_bounding_box | ||
|
|
@@ -22,17 +20,12 @@ | |
| N_EXAMPLE_SOURCES = 21 | ||
| N_CUSTOM_SOURCES = 15 | ||
| REFCAT = "GAIADR3" | ||
| PHOTUTILS_GE_3 = minversion(photutils, "2.3.1.dev") | ||
|
|
||
| # The tweakreg catalog output always uses 'xcentroid'/'ycentroid', | ||
| # but _rename_catalog_columns and user-supplied catalogs may use | ||
| # either the old or new photutils column names. | ||
|
Comment on lines
24
to
26
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this comment still relevant? |
||
| if PHOTUTILS_GE_3: | ||
| X_NAME = "x_centroid" | ||
| Y_NAME = "y_centroid" | ||
| else: | ||
| X_NAME = "xcentroid" | ||
| Y_NAME = "ycentroid" | ||
| X_NAME = "x_centroid" | ||
| Y_NAME = "y_centroid" | ||
|
|
||
|
|
||
| @pytest.fixture | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't
self.minsep_fwhmalways be set as an attribute since it's in the spec, so there's no need for theNonesetting if undefined?