Skip to content
New issue

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

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

Already on GitHub? # to your account

MNT: Bump photutils minversion to 1.12.1 #3432

Merged
merged 2 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ Specviz2d
Other Changes and Additions
---------------------------

- Bumped minimum version of ``photutils`` to v1.12.1. [#3432]

4.1.2 (unreleased)
==================

Expand Down
16 changes: 4 additions & 12 deletions jdaviz/configs/imviz/tests/test_simple_aper_phot.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
_curve_of_growth, _radial_profile)
from jdaviz.configs.imviz.tests.utils import BaseImviz_WCS_WCS, BaseImviz_WCS_NoWCS
from jdaviz.core.custom_units_and_equivs import PIX2
from jdaviz.tests.test_utils import PHOTUTILS_LT_1_12_1


class TestSimpleAperPhot(BaseImviz_WCS_WCS):
Expand Down Expand Up @@ -338,17 +337,10 @@ def test_sky_background(self, data_label, fac, bg_label, expected_bg):
def test_annulus_background(imviz_helper):
gauss4 = make_4gaussians_image() # The background has a mean of 5 with noise
ones = np.ones(gauss4.shape)

if PHOTUTILS_LT_1_12_1:
bg_4gauss_1 = 5.745596129482831
bg_4gauss_2 = 5.13918435824334
bg_4gauss_3 = 44.72559981461203
bg_4gauss_4 = 4.89189
else:
bg_4gauss_1 = 5.802287
bg_4gauss_2 = 5.052332
bg_4gauss_3 = 45.416834
bg_4gauss_4 = 4.939397
bg_4gauss_1 = 5.802287
bg_4gauss_2 = 5.052332
bg_4gauss_3 = 45.416834
bg_4gauss_4 = 4.939397

imviz_helper.load_data(gauss4, data_label='four_gaussians')
imviz_helper.load_data(ones, data_label='ones')
Expand Down
14 changes: 3 additions & 11 deletions jdaviz/core/tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from photutils.datasets import make_4gaussians_image
from specutils import Spectrum1D

from jdaviz.tests.test_utils import PHOTUTILS_LT_1_12_1


def test_boxzoom(cubeviz_helper, image_cube_hdu_obj_microns):
cubeviz_helper.load_data(image_cube_hdu_obj_microns, data_label="Test Flux")
Expand Down Expand Up @@ -100,15 +98,9 @@ def test_stretch_bounds_and_spline(imviz_helper):
"domain": {"x": 11.639166666374734, "y": 970.9392968750001},
}

if PHOTUTILS_LT_1_12_1:
knots_after_drag_move = (
[0.0, 0.1, 0.21712585033417825, 0.7, 1.0],
[0.0, 0.05, 0.2852214046563617, 0.9, 1.0],
)
else:
knots_after_drag_move = (
[0.0, 0.1, 0.21712585033417825, 0.7, 1.0],
[0.0, 0.05, 0.2698132855572785, 0.9, 1.0])
knots_after_drag_move = (
[0.0, 0.1, 0.21712585033417825, 0.7, 1.0],
[0.0, 0.05, 0.2698132855572785, 0.9, 1.0])

stretch_tool.on_mouse_event(knot_move_msg)

Expand Down
4 changes: 0 additions & 4 deletions jdaviz/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import os
import warnings

import photutils
import pytest
from asdf.exceptions import AsdfWarning
from astropy import units as u
from astropy.utils import minversion
from astropy.wcs import FITSFixedWarning
from numpy.testing import assert_allclose
from specutils import Spectrum1D
Expand All @@ -14,8 +12,6 @@
from jdaviz.utils import (alpha_index, download_uri_to_path, flux_conversion,
_indirect_conversion, _eqv_pixar_sr)

PHOTUTILS_LT_1_12_1 = not minversion(photutils, "1.12.1.dev")


def test_spec_sb_flux_conversion():
# Actual spectrum content does not matter, just the meta is used here.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies = [
"pyyaml>=5.4.1",
"specutils>=1.18",
"specreduce>=1.4.1",
"photutils>=1.4",
"photutils>=1.12.1",
"glue-astronomy>=0.10",
"asteval>=0.9.23",
"idna",
Expand Down