From 522551d423ad55eae7f3edd19258b4c7fcc3e8fe Mon Sep 17 00:00:00 2001 From: havok2063 Date: Fri, 21 Jun 2024 15:14:48 -0400 Subject: [PATCH] fixing import lint issues --- python/marvin/tools/mixins/aperture.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/python/marvin/tools/mixins/aperture.py b/python/marvin/tools/mixins/aperture.py index a7b69a60..e10b8c34 100644 --- a/python/marvin/tools/mixins/aperture.py +++ b/python/marvin/tools/mixins/aperture.py @@ -15,15 +15,15 @@ try: - from photutils import aperture + import photutils.aperture as pap except ImportError: - aperture = None + pap = None __all__ = ['GetApertureMixIn', 'MarvinAperture'] -class MarvinAperture(aperture.Aperture if aperture.Aperture else object): +class MarvinAperture(pap.Aperture if pap.Aperture else object): """Extends `photutils.aperture.Aperture` allowing to extract spaxels in the aperture. This class is not intended for general use and it is dynamically set as @@ -57,7 +57,7 @@ def mask(self): assert self.parent is not None, 'no parent set' - if isinstance(self, aperture.SkyAperture): + if isinstance(self, pap.SkyAperture): aperture = self.to_pixel(self.parent.wcs) else: aperture = self @@ -198,7 +198,7 @@ def getAperture(self, coords, aperture_params, aperture_type='circular', """ - if aperture is None: + if pap is None: raise ImportError('this feature requires photutils. Install it by ' 'doing pip install photutils.') @@ -215,19 +215,19 @@ def getAperture(self, coords, aperture_params, aperture_type='circular', if aperture_type == 'circular': if coord_type == 'pixel': - ApertureClass = aperture.CircularAperture + ApertureClass = pap.CircularAperture else: - ApertureClass = aperture.SkyCircularAperture + ApertureClass = pap.SkyCircularAperture elif aperture_type == 'elliptical': if coord_type == 'pixel': - ApertureClass = aperture.EllipticalAperture + ApertureClass = pap.EllipticalAperture else: - ApertureClass = aperture.SkyEllipticalAperture + ApertureClass = pap.SkyEllipticalAperture elif aperture_type == 'rectangular': if coord_type == 'pixel': - ApertureClass = aperture.RectangularAperture + ApertureClass = pap.RectangularAperture else: - ApertureClass = aperture.SkyRectangularAperture + ApertureClass = pap.SkyRectangularAperture else: raise ValueError('invalid aperture_type')