Skip to content

Commit

Permalink
Autofix unsorted-dunder-all (RUF022)
Browse files Browse the repository at this point in the history
  • Loading branch information
larrybradley committed Nov 26, 2024
1 parent 9849219 commit 3392c91
Show file tree
Hide file tree
Showing 21 changed files with 80 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ repos:
# Enforce that all noqa annotations always occur with specific codes.

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.7.2"
rev: "v0.8.0"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down
10 changes: 8 additions & 2 deletions photutils/aperture/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
import numpy as np
from astropy.coordinates import SkyCoord

__all__ = ['ApertureAttribute', 'PixelPositions', 'SkyCoordPositions',
'PositiveScalar', 'ScalarAngle', 'ScalarAngleOrValue']
__all__ = [
'ApertureAttribute',
'PixelPositions',
'PositiveScalar',
'ScalarAngle',
'ScalarAngleOrValue',
'SkyCoordPositions',
]


class ApertureAttribute:
Expand Down
9 changes: 7 additions & 2 deletions photutils/aperture/circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@
from photutils.aperture.mask import ApertureMask
from photutils.geometry import circular_overlap_grid

__all__ = ['CircularMaskMixin', 'CircularAperture', 'CircularAnnulus',
'SkyCircularAperture', 'SkyCircularAnnulus']
__all__ = [
'CircularAnnulus',
'CircularAperture',
'CircularMaskMixin',
'SkyCircularAnnulus',
'SkyCircularAperture',
]


class CircularMaskMixin:
Expand Down
2 changes: 1 addition & 1 deletion photutils/aperture/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from photutils.aperture.bounding_box import BoundingBox
from photutils.utils._wcs_helpers import _pixel_scale_angle_at_skycoord

__all__ = ['Aperture', 'SkyAperture', 'PixelAperture']
__all__ = ['Aperture', 'PixelAperture', 'SkyAperture']


class Aperture(metaclass=abc.ABCMeta):
Expand Down
9 changes: 7 additions & 2 deletions photutils/aperture/ellipse.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
from photutils.aperture.mask import ApertureMask
from photutils.geometry import elliptical_overlap_grid

__all__ = ['EllipticalMaskMixin', 'EllipticalAperture', 'EllipticalAnnulus',
'SkyEllipticalAperture', 'SkyEllipticalAnnulus']
__all__ = [
'EllipticalAnnulus',
'EllipticalAperture',
'EllipticalMaskMixin',
'SkyEllipticalAnnulus',
'SkyEllipticalAperture',
]


class EllipticalMaskMixin:
Expand Down
10 changes: 7 additions & 3 deletions photutils/aperture/rectangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
from photutils.aperture.mask import ApertureMask
from photutils.geometry import rectangular_overlap_grid

__all__ = ['RectangularMaskMixin', 'RectangularAperture',
'RectangularAnnulus', 'SkyRectangularAperture',
'SkyRectangularAnnulus']
__all__ = [
'RectangularAnnulus',
'RectangularAperture',
'RectangularMaskMixin',
'SkyRectangularAnnulus',
'SkyRectangularAperture',
]


class RectangularMaskMixin:
Expand Down
18 changes: 13 additions & 5 deletions photutils/background/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,19 @@

SIGMA_CLIP = SigmaClip(sigma=3.0, maxiters=10)

__all__ = ['BackgroundBase', 'BackgroundRMSBase', 'MeanBackground',
'MedianBackground', 'ModeEstimatorBackground',
'MMMBackground', 'SExtractorBackground',
'BiweightLocationBackground', 'StdBackgroundRMS',
'MADStdBackgroundRMS', 'BiweightScaleBackgroundRMS']
__all__ = [
'BackgroundBase',
'BackgroundRMSBase',
'BiweightLocationBackground',
'BiweightScaleBackgroundRMS',
'MADStdBackgroundRMS',
'MMMBackground',
'MeanBackground',
'MedianBackground',
'ModeEstimatorBackground',
'SExtractorBackground',
'StdBackgroundRMS',
]


class BackgroundBase(metaclass=abc.ABCMeta):
Expand Down
2 changes: 1 addition & 1 deletion photutils/background/interpolators.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from photutils.utils import ShepardIDWInterpolator
from photutils.utils._repr import make_repr

__all__ = ['BkgZoomInterpolator', 'BkgIDWInterpolator']
__all__ = ['BkgIDWInterpolator', 'BkgZoomInterpolator']


class BkgZoomInterpolator:
Expand Down
10 changes: 8 additions & 2 deletions photutils/datasets/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@
from astropy.table import Table
from astropy.utils.data import download_file, get_pkg_data_filename

__all__ = ['get_path', 'load_spitzer_image', 'load_spitzer_catalog',
'load_irac_psf', 'load_star_image', 'load_simulated_hst_star_image']
__all__ = [
'get_path',
'load_irac_psf',
'load_simulated_hst_star_image',
'load_spitzer_catalog',
'load_spitzer_image',
'load_star_image',
]


def get_path(filename, location='local', cache=True, show_progress=False):
Expand Down
2 changes: 1 addition & 1 deletion photutils/datasets/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from astropy.modeling import models
from astropy.wcs import WCS

__all__ = ['make_wcs', 'make_gwcs']
__all__ = ['make_gwcs', 'make_wcs']

__doctest_requires__ = {'make_gwcs': ['gwcs']}

Expand Down
2 changes: 1 addition & 1 deletion photutils/isophote/integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import numpy as np

__all__ = ['INTEGRATORS', 'NEAREST_NEIGHBOR', 'BILINEAR', 'MEAN', 'MEDIAN']
__all__ = ['BILINEAR', 'INTEGRATORS', 'MEAN', 'MEDIAN', 'NEAREST_NEIGHBOR']


# integration modes
Expand Down
2 changes: 1 addition & 1 deletion photutils/psf/epsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from photutils.utils._stats import nanmedian
from photutils.utils.cutouts import _overlap_slices as overlap_slices

__all__ = ['EPSFFitter', 'EPSFBuilder']
__all__ = ['EPSFBuilder', 'EPSFFitter']


class EPSFFitter:
Expand Down
13 changes: 10 additions & 3 deletions photutils/psf/functional_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@
from astropy.utils.decorators import deprecated
from scipy.special import erf, j1, jn_zeros

__all__ = ['GaussianPSF', 'CircularGaussianPSF', 'GaussianPRF',
'CircularGaussianPRF', 'CircularGaussianSigmaPRF',
'IntegratedGaussianPRF', 'MoffatPSF', 'AiryDiskPSF']
__all__ = [
'AiryDiskPSF',
'CircularGaussianPRF',
'CircularGaussianPSF',
'CircularGaussianSigmaPRF',
'GaussianPRF',
'GaussianPSF',
'IntegratedGaussianPRF',
'MoffatPSF',
]

FLOAT_EPSILON = float(np.finfo(np.float32).tiny)
GAUSSIAN_FWHM_TO_SIGMA = 1.0 / (2.0 * np.sqrt(2.0 * np.log(2.0)))
Expand Down
2 changes: 1 addition & 1 deletion photutils/psf/image_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from photutils.aperture import CircularAperture
from photutils.utils._parameters import as_pair

__all__ = ['ImagePSF', 'FittableImageModel', 'EPSFModel']
__all__ = ['EPSFModel', 'FittableImageModel', 'ImagePSF']


class ImagePSF(Fittable2DModel):
Expand Down
2 changes: 1 addition & 1 deletion photutils/psf/matching/fourier.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from numpy.fft import fft2, fftshift, ifft2, ifftshift
from scipy.ndimage import zoom

__all__ = ['resize_psf', 'create_matching_kernel']
__all__ = ['create_matching_kernel', 'resize_psf']


def resize_psf(psf, input_pixel_scale, output_pixel_scale, *, order=3):
Expand Down
9 changes: 7 additions & 2 deletions photutils/psf/matching/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@

import numpy as np

__all__ = ['SplitCosineBellWindow', 'HanningWindow', 'TukeyWindow',
'CosineBellWindow', 'TopHatWindow']
__all__ = [
'CosineBellWindow',
'HanningWindow',
'SplitCosineBellWindow',
'TopHatWindow',
'TukeyWindow',
]


def _radial_distance(shape):
Expand Down
2 changes: 1 addition & 1 deletion photutils/psf/model_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from astropy.utils.decorators import deprecated
from scipy.integrate import dblquad, trapezoid

__all__ = ['make_psf_model', 'grid_from_epsfs', 'PRFAdapter']
__all__ = ['PRFAdapter', 'grid_from_epsfs', 'make_psf_model']


def make_psf_model(model, *, x_name=None, y_name=None, flux_name=None,
Expand Down
2 changes: 1 addition & 1 deletion photutils/psf/photometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from photutils.utils.cutouts import _overlap_slices as overlap_slices
from photutils.utils.exceptions import NoDetectionsWarning

__all__ = ['ModelImageMixin', 'PSFPhotometry', 'IterativePSFPhotometry']
__all__ = ['IterativePSFPhotometry', 'ModelImageMixin', 'PSFPhotometry']


class ModelImageMixin:
Expand Down
2 changes: 1 addition & 1 deletion photutils/segmentation/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from photutils.utils._parameters import as_pair
from photutils.utils.colormaps import make_random_cmap

__all__ = ['SegmentationImage', 'Segment']
__all__ = ['Segment', 'SegmentationImage']


class SegmentationImage:
Expand Down
2 changes: 1 addition & 1 deletion photutils/segmentation/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from photutils.utils._stats import nanmean, nanstd
from photutils.utils.exceptions import NoDetectionsWarning

__all__ = ['detect_threshold', 'detect_sources']
__all__ = ['detect_sources', 'detect_threshold']


def detect_threshold(data, nsigma, *, background=None, error=None, mask=None,
Expand Down
2 changes: 1 addition & 1 deletion photutils/utils/_moments.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import numpy as np

__all__ = ['_moments_central', '_moments']
__all__ = ['_moments', '_moments_central']


def _moments_central(data, center=None, order=1):
Expand Down

0 comments on commit 3392c91

Please sign in to comment.