From 45a0df8b74d218dd3edc9f36971c9402e0d4a861 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 11:58:10 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- romancal/associations/generate.py | 8 ++------ romancal/associations/lib/dms_base.py | 7 ++----- romancal/associations/lib/rules_elpp_base.py | 20 ++++++++----------- romancal/associations/tests/helpers.py | 3 ++- .../associations/tests/test_constraints.py | 7 ++----- romancal/associations/tests/test_generate.py | 8 ++------ .../associations/tests/test_level2_basics.py | 7 ++----- .../tests/test_level2_candidates.py | 7 ++----- romancal/outlier_detection/utils.py | 8 ++------ romancal/pipeline/exposure_pipeline.py | 1 - romancal/pipeline/mosaic_pipeline.py | 1 - .../ramp_fitting/tests/test_ramp_fit_cas22.py | 8 ++------ romancal/refpix/tests/test_data.py | 9 ++------- romancal/regtest/regtestdata.py | 9 ++------- romancal/regtest/test_multiband_catalog.py | 3 ++- romancal/resample/tests/test_resample.py | 7 ++----- romancal/scripts/static_preview.py | 7 ++----- romancal/skymatch/skymatch_step.py | 3 ++- romancal/source_catalog/source_catalog.py | 3 ++- .../source_catalog/source_catalog_step.py | 3 ++- .../tests/test_source_catalog.py | 13 +++++------- .../tweakreg/tests/test_astrometric_utils.py | 8 +++----- romancal/tweakreg/tweakreg_step.py | 3 ++- 23 files changed, 52 insertions(+), 101 deletions(-) diff --git a/romancal/associations/generate.py b/romancal/associations/generate.py index f8f012c80..aa3a72d05 100644 --- a/romancal/associations/generate.py +++ b/romancal/associations/generate.py @@ -3,12 +3,8 @@ from ..lib.progress import Bar from .association import make_timestamp -from .lib.process_list import ( - ListCategory, - ProcessList, - ProcessQueueSorted, - workover_filter, -) +from .lib.process_list import (ListCategory, ProcessList, ProcessQueueSorted, + workover_filter) from .pool import PoolRow # Configure logging diff --git a/romancal/associations/lib/dms_base.py b/romancal/associations/lib/dms_base.py index 660b30804..5baca4b38 100644 --- a/romancal/associations/lib/dms_base.py +++ b/romancal/associations/lib/dms_base.py @@ -2,11 +2,8 @@ from romancal.associations.exceptions import AssociationNotValidError from romancal.associations.lib.acid import ACIDMixin -from romancal.associations.lib.constraint import ( - AttrConstraint, - Constraint, - SimpleConstraint, -) +from romancal.associations.lib.constraint import (AttrConstraint, Constraint, + SimpleConstraint) from romancal.associations.lib.counter import Counter from romancal.associations.lib.utilities import getattr_from_list diff --git a/romancal/associations/lib/rules_elpp_base.py b/romancal/associations/lib/rules_elpp_base.py index 6640fd1e8..cdaf8f65d 100644 --- a/romancal/associations/lib/rules_elpp_base.py +++ b/romancal/associations/lib/rules_elpp_base.py @@ -14,22 +14,18 @@ from romancal.associations.lib.acid import ACID from romancal.associations.lib.constraint import Constraint, SimpleConstraint from romancal.associations.lib.counter import Counter -from romancal.associations.lib.dms_base import ( - _EMPTY, - IMAGE2_NONSCIENCE_EXP_TYPES, - IMAGE2_SCIENCE_EXP_TYPES, - SPEC2_SCIENCE_EXP_TYPES, - WFI_DETECTORS, - DMSAttrConstraint, - DMSBaseMixin, -) +from romancal.associations.lib.dms_base import (_EMPTY, + IMAGE2_NONSCIENCE_EXP_TYPES, + IMAGE2_SCIENCE_EXP_TYPES, + SPEC2_SCIENCE_EXP_TYPES, + WFI_DETECTORS, + DMSAttrConstraint, + DMSBaseMixin) from romancal.associations.lib.keyvalue_registry import KeyValueRegistryError from romancal.associations.lib.member import Member from romancal.associations.lib.process_list import ProcessList from romancal.associations.lib.product_utils import ( - prune_duplicate_associations, - prune_duplicate_products, -) + prune_duplicate_associations, prune_duplicate_products) from romancal.associations.lib.utilities import evaluate, is_iterable from romancal.associations.registry import RegistryMarker diff --git a/romancal/associations/tests/helpers.py b/romancal/associations/tests/helpers.py index 00d2418f9..bf57235aa 100644 --- a/romancal/associations/tests/helpers.py +++ b/romancal/associations/tests/helpers.py @@ -11,7 +11,8 @@ import pytest from astropy.table import Table, vstack -from romancal.associations import AssociationPool, AssociationRegistry, generate +from romancal.associations import (AssociationPool, AssociationRegistry, + generate) from romancal.associations.lib.counter import Counter from romancal.associations.lib.utilities import is_iterable diff --git a/romancal/associations/tests/test_constraints.py b/romancal/associations/tests/test_constraints.py index e4606b453..7e1524761 100644 --- a/romancal/associations/tests/test_constraints.py +++ b/romancal/associations/tests/test_constraints.py @@ -2,11 +2,8 @@ import pytest -from romancal.associations.lib.constraint import ( - Constraint, - SimpleConstraint, - SimpleConstraintABC, -) +from romancal.associations.lib.constraint import (Constraint, SimpleConstraint, + SimpleConstraintABC) def test_sc_dup_names(): diff --git a/romancal/associations/tests/test_generate.py b/romancal/associations/tests/test_generate.py index 8c34b157b..41424411b 100644 --- a/romancal/associations/tests/test_generate.py +++ b/romancal/associations/tests/test_generate.py @@ -1,11 +1,7 @@ """Test basic generate operations""" -from romancal.associations import ( - AssociationPool, - AssociationRegistry, - generate, - load_asn, -) +from romancal.associations import (AssociationPool, AssociationRegistry, + generate, load_asn) from romancal.associations.tests.helpers import t_path diff --git a/romancal/associations/tests/test_level2_basics.py b/romancal/associations/tests/test_level2_basics.py index 663452150..bcd02c648 100644 --- a/romancal/associations/tests/test_level2_basics.py +++ b/romancal/associations/tests/test_level2_basics.py @@ -2,11 +2,8 @@ from romancal.associations import generate, load_asn from romancal.associations.main import Main -from romancal.associations.tests.helpers import ( - combine_pools, - registry_level2_only, - t_path, -) +from romancal.associations.tests.helpers import (combine_pools, + registry_level2_only, t_path) # REGEX_LEVEL2 = r'(?P.+)(?P_rate(ints)?)(?P\..+)' # REGEX_LEVEL2 = r'(?P.+)(.*\_.*\_.*\_.*\_.*)' diff --git a/romancal/associations/tests/test_level2_candidates.py b/romancal/associations/tests/test_level2_candidates.py index 76007ce05..8aaa1e0eb 100644 --- a/romancal/associations/tests/test_level2_candidates.py +++ b/romancal/associations/tests/test_level2_candidates.py @@ -3,11 +3,8 @@ import pytest from romancal.associations.main import Main -from romancal.associations.tests.helpers import ( - level2_rule_path, - mkstemp_pool_file, - t_path, -) +from romancal.associations.tests.helpers import (level2_rule_path, + mkstemp_pool_file, t_path) @pytest.mark.parametrize( diff --git a/romancal/outlier_detection/utils.py b/romancal/outlier_detection/utils.py index 24b17ed23..567eb4a49 100644 --- a/romancal/outlier_detection/utils.py +++ b/romancal/outlier_detection/utils.py @@ -5,12 +5,8 @@ import numpy as np from roman_datamodels.dqflags import pixel from stcal.outlier_detection.median import MedianComputer -from stcal.outlier_detection.utils import ( - compute_weight_threshold, - flag_crs, - flag_resampled_crs, - gwcs_blot, -) +from stcal.outlier_detection.utils import (compute_weight_threshold, flag_crs, + flag_resampled_crs, gwcs_blot) from romancal.resample.resample import ResampleData from romancal.resample.resample_utils import build_driz_weight diff --git a/romancal/pipeline/exposure_pipeline.py b/romancal/pipeline/exposure_pipeline.py index 55d5acac2..e46bc49b1 100644 --- a/romancal/pipeline/exposure_pipeline.py +++ b/romancal/pipeline/exposure_pipeline.py @@ -5,7 +5,6 @@ from roman_datamodels.dqflags import group import romancal.datamodels.filetype as filetype - # step imports from romancal.assign_wcs import AssignWcsStep from romancal.dark_current import DarkCurrentStep diff --git a/romancal/pipeline/mosaic_pipeline.py b/romancal/pipeline/mosaic_pipeline.py index eca8d02dd..4cfac0665 100644 --- a/romancal/pipeline/mosaic_pipeline.py +++ b/romancal/pipeline/mosaic_pipeline.py @@ -12,7 +12,6 @@ import romancal.datamodels.filetype as filetype from romancal.datamodels import ModelLibrary - # step imports from romancal.flux import FluxStep from romancal.outlier_detection import OutlierDetectionStep diff --git a/romancal/ramp_fitting/tests/test_ramp_fit_cas22.py b/romancal/ramp_fitting/tests/test_ramp_fit_cas22.py index e64ebcf08..437174f43 100644 --- a/romancal/ramp_fitting/tests/test_ramp_fit_cas22.py +++ b/romancal/ramp_fitting/tests/test_ramp_fit_cas22.py @@ -5,12 +5,8 @@ from astropy import units as u from astropy.time import Time from roman_datamodels import maker_utils -from roman_datamodels.datamodels import ( - DarkRefModel, - GainRefModel, - RampModel, - ReadnoiseRefModel, -) +from roman_datamodels.datamodels import (DarkRefModel, GainRefModel, RampModel, + ReadnoiseRefModel) from romancal.ramp_fitting import RampFitStep diff --git a/romancal/refpix/tests/test_data.py b/romancal/refpix/tests/test_data.py index 75fa2b854..31a82cdc1 100644 --- a/romancal/refpix/tests/test_data.py +++ b/romancal/refpix/tests/test_data.py @@ -1,13 +1,8 @@ import numpy as np from numpy.testing import assert_allclose -from romancal.refpix.data import ( - ChannelView, - Coefficients, - Const, - ReferenceFFT, - StandardView, -) +from romancal.refpix.data import (ChannelView, Coefficients, Const, + ReferenceFFT, StandardView) from . import reference_utils from .conftest import RNG, Dims diff --git a/romancal/regtest/regtestdata.py b/romancal/regtest/regtestdata.py index 08874cd59..b5dfad6d3 100644 --- a/romancal/regtest/regtestdata.py +++ b/romancal/regtest/regtestdata.py @@ -16,17 +16,12 @@ import numpy as np import requests from astropy.units import Quantity -from ci_watson.artifactory_helpers import ( - BigdataError, - check_url, - get_bigdata, - get_bigdata_root, -) +from ci_watson.artifactory_helpers import (BigdataError, check_url, + get_bigdata, get_bigdata_root) from deepdiff.operator import BaseOperator from gwcs.wcstools import grid_from_bounding_box from romancal.associations.load_asn import load_asn - # from romancal.lib.suffix import replace_suffix from romancal.stpipe import RomanStep diff --git a/romancal/regtest/test_multiband_catalog.py b/romancal/regtest/test_multiband_catalog.py index a5bc1dda0..7daae521e 100644 --- a/romancal/regtest/test_multiband_catalog.py +++ b/romancal/regtest/test_multiband_catalog.py @@ -3,7 +3,8 @@ import asdf import pytest -from romancal.multiband_catalog.multiband_catalog_step import MultibandCatalogStep +from romancal.multiband_catalog.multiband_catalog_step import \ + MultibandCatalogStep from romancal.stpipe import RomanStep # mark all tests in this module diff --git a/romancal/resample/tests/test_resample.py b/romancal/resample/tests/test_resample.py index ec8a27b69..1aede20b6 100644 --- a/romancal/resample/tests/test_resample.py +++ b/romancal/resample/tests/test_resample.py @@ -13,11 +13,8 @@ from romancal.datamodels import ModelLibrary from romancal.lib.tests.helpers import word_precision_check from romancal.resample import gwcs_drizzle, resample_utils -from romancal.resample.resample import ( - ResampleData, - populate_mosaic_basic, - populate_mosaic_individual, -) +from romancal.resample.resample import (ResampleData, populate_mosaic_basic, + populate_mosaic_individual) # Helper function to create a mock input model with specified metadata diff --git a/romancal/scripts/static_preview.py b/romancal/scripts/static_preview.py index f690c157c..014fe598d 100644 --- a/romancal/scripts/static_preview.py +++ b/romancal/scripts/static_preview.py @@ -9,11 +9,8 @@ def command(): try: import typer from stpreview.downsample import downsample_asdf_to - from stpreview.image import ( - north_pole_angle, - percentile_normalization, - write_image, - ) + from stpreview.image import (north_pole_angle, + percentile_normalization, write_image) from typing_extensions import Annotated except (ImportError, ModuleNotFoundError): raise ImportError( diff --git a/romancal/skymatch/skymatch_step.py b/romancal/skymatch/skymatch_step.py index 309f99fbc..7c9038360 100644 --- a/romancal/skymatch/skymatch_step.py +++ b/romancal/skymatch/skymatch_step.py @@ -6,7 +6,8 @@ from copy import deepcopy import numpy as np -from astropy.nddata.bitmask import bitfield_to_boolean_mask, interpret_bit_flags +from astropy.nddata.bitmask import (bitfield_to_boolean_mask, + interpret_bit_flags) from roman_datamodels import maker_utils from roman_datamodels.dqflags import pixel diff --git a/romancal/source_catalog/source_catalog.py b/romancal/source_catalog/source_catalog.py index f76c920c7..790597224 100644 --- a/romancal/source_catalog/source_catalog.py +++ b/romancal/source_catalog/source_catalog.py @@ -15,7 +15,8 @@ from astropy.table import QTable, Table from astropy.utils import lazyproperty from astropy.utils.exceptions import AstropyUserWarning -from photutils.aperture import CircularAnnulus, CircularAperture, aperture_photometry +from photutils.aperture import (CircularAnnulus, CircularAperture, + aperture_photometry) from photutils.segmentation import SourceCatalog from roman_datamodels.datamodels import ImageModel, MosaicModel from roman_datamodels.dqflags import pixel diff --git a/romancal/source_catalog/source_catalog_step.py b/romancal/source_catalog/source_catalog_step.py index 1337f44ae..7cc7ceedf 100644 --- a/romancal/source_catalog/source_catalog_step.py +++ b/romancal/source_catalog/source_catalog_step.py @@ -9,7 +9,8 @@ from roman_datamodels.maker_utils import mk_datamodel from romancal.source_catalog.background import RomanBackground -from romancal.source_catalog.detection import convolve_data, make_segmentation_image +from romancal.source_catalog.detection import (convolve_data, + make_segmentation_image) from romancal.source_catalog.reference_data import ReferenceData from romancal.source_catalog.source_catalog import RomanSourceCatalog from romancal.stpipe import RomanStep diff --git a/romancal/source_catalog/tests/test_source_catalog.py b/romancal/source_catalog/tests/test_source_catalog.py index c414f9e2d..c8dea608f 100644 --- a/romancal/source_catalog/tests/test_source_catalog.py +++ b/romancal/source_catalog/tests/test_source_catalog.py @@ -9,14 +9,11 @@ from numpy.testing import assert_equal from photutils.segmentation import SegmentationImage from roman_datamodels import datamodels as rdm -from roman_datamodels.datamodels import ( - ImageModel, - ImageSourceCatalogModel, - MosaicModel, - MosaicSegmentationMapModel, - MosaicSourceCatalogModel, - SegmentationMapModel, -) +from roman_datamodels.datamodels import (ImageModel, ImageSourceCatalogModel, + MosaicModel, + MosaicSegmentationMapModel, + MosaicSourceCatalogModel, + SegmentationMapModel) from roman_datamodels.maker_utils import mk_level2_image, mk_level3_mosaic from romancal.source_catalog.reference_data import ReferenceData diff --git a/romancal/tweakreg/tests/test_astrometric_utils.py b/romancal/tweakreg/tests/test_astrometric_utils.py index ee5071f46..c0a83cdcb 100644 --- a/romancal/tweakreg/tests/test_astrometric_utils.py +++ b/romancal/tweakreg/tests/test_astrometric_utils.py @@ -19,11 +19,9 @@ from roman_datamodels import datamodels as rdm from roman_datamodels import maker_utils -from romancal.tweakreg.astrometric_utils import ( - compute_radius, - create_astrometric_catalog, - get_catalog, -) +from romancal.tweakreg.astrometric_utils import (compute_radius, + create_astrometric_catalog, + get_catalog) ARAD = np.pi / 180.0 diff --git a/romancal/tweakreg/tweakreg_step.py b/romancal/tweakreg/tweakreg_step.py index 974bcd59b..3c957e2c7 100644 --- a/romancal/tweakreg/tweakreg_step.py +++ b/romancal/tweakreg/tweakreg_step.py @@ -9,7 +9,8 @@ from astropy.table import Table from roman_datamodels import datamodels as rdm from stcal.tweakreg import tweakreg -from stcal.tweakreg.tweakreg import _SINGLE_GROUP_REFCAT_STR, SINGLE_GROUP_REFCAT +from stcal.tweakreg.tweakreg import (_SINGLE_GROUP_REFCAT_STR, + SINGLE_GROUP_REFCAT) from romancal.assign_wcs.utils import add_s_region