Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 14, 2024
1 parent 06b8f43 commit 45a0df8
Show file tree
Hide file tree
Showing 23 changed files with 52 additions and 101 deletions.
8 changes: 2 additions & 6 deletions romancal/associations/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions romancal/associations/lib/dms_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 8 additions & 12 deletions romancal/associations/lib/rules_elpp_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion romancal/associations/tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 2 additions & 5 deletions romancal/associations/tests/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
8 changes: 2 additions & 6 deletions romancal/associations/tests/test_generate.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
7 changes: 2 additions & 5 deletions romancal/associations/tests/test_level2_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<path>.+)(?P<type>_rate(ints)?)(?P<extension>\..+)'
# REGEX_LEVEL2 = r'(?P<path>.+)(.*\_.*\_.*\_.*\_.*)'
Expand Down
7 changes: 2 additions & 5 deletions romancal/associations/tests/test_level2_candidates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 2 additions & 6 deletions romancal/outlier_detection/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion romancal/pipeline/exposure_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion romancal/pipeline/mosaic_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions romancal/ramp_fitting/tests/test_ramp_fit_cas22.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 2 additions & 7 deletions romancal/refpix/tests/test_data.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 2 additions & 7 deletions romancal/regtest/regtestdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion romancal/regtest/test_multiband_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions romancal/resample/tests/test_resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions romancal/scripts/static_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion romancal/skymatch/skymatch_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion romancal/source_catalog/source_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion romancal/source_catalog/source_catalog_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 5 additions & 8 deletions romancal/source_catalog/tests/test_source_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions romancal/tweakreg/tests/test_astrometric_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion romancal/tweakreg/tweakreg_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 45a0df8

Please sign in to comment.