Skip to content

Commit

Permalink
TST: Adjust Lorentz1D FWHM result
Browse files Browse the repository at this point in the history
to be compatible with astropy v7.0
probably due to astropy/astropy#16794 bug fix upstream.
  • Loading branch information
pllim committed Aug 19, 2024
1 parent 2b0b08c commit 11d7655
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ginga/tests/test_iqcalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

import numpy as np
import pytest
from astropy.utils import minversion
from numpy.testing import assert_allclose, assert_array_equal

from ginga.AstroImage import AstroImage
from ginga.util import iqcalc, iqcalc_astropy
from ginga.util.iqcalc import have_scipy # noqa
from ginga.util.iqcalc_astropy import have_photutils # noqa

ASTROPY_LT_7_0 = not minversion("astropy", "7.0.dev")


@pytest.mark.parametrize(
('arr', 'ans'),
Expand Down Expand Up @@ -284,7 +287,13 @@ def setup_class(self):
self.fwhm_funcs = (self.iqcalc.calc_fwhm_gaussian,
self.iqcalc.calc_fwhm_moffat,
self.iqcalc.calc_fwhm_lorentz)
if ASTROPY_LT_7_0:
lorentz_ans = (1.9570, 1.8113)
else:
# https://github.com/astropy/astropy/pull/16794
lorentz_ans = (2.340321, 2.068428)

self.answers = ((2.8551, 2.7732), # Gaussian
(2.77949, 2.6735), # Moffat
(1.9570, 1.8113) # Lorentz
lorentz_ans # Lorentz
)

0 comments on commit 11d7655

Please sign in to comment.