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 Mar 21, 2023
1 parent 05ff1e7 commit 8045c07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions romancal/source_detection/source_detection_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SourceDetectionStep(RomanStep):
max_sources = float(default=None) # Max number of sources, choosing brightest.
scalar_threshold = float(default=None) # Detection threshold, to
# be used for entire image. Assumed to be in same units as data, and is
# an absolute threshold over background.
# an absolute threshold over background.
calc_threshold = boolean(default=True) # Calculate a single absoulte
# detection threshold from image based on background.
snr_threshold = float(default=3.0) # if calc_threshold_img or
Expand Down Expand Up @@ -118,8 +118,7 @@ def process(self, input):

elif self.calc_threshold is not None:
# subtrack background from data if calculating abs. threshold
sources = daofind(self.data - bkg.background,
mask=self.coverage_mask)
sources = daofind(self.data - bkg.background, mask=self.coverage_mask)

# reduce table to minimal number of columns, just source ID,
# positions, and fluxes
Expand Down
12 changes: 6 additions & 6 deletions romancal/source_detection/tests/test_source_detection_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _setup(nrows=100, ncols=100, noise=1.0):
@pytest.mark.skipif(
os.environ.get("CI") == "true",
reason="Roman CRDS servers are not currently available outside the internal "
"network",
"network",
)
def add_random_gauss(arr, x_positions, y_positions, min_amp=200, max_amp=500):

Expand All @@ -69,7 +69,7 @@ def add_random_gauss(arr, x_positions, y_positions, min_amp=200, max_amp=500):
@pytest.mark.skipif(
os.environ.get("CI") == "true",
reason="Roman CRDS servers are not currently available outside the internal "
"network",
"network",
)
def test_source_detection_defaults(setup_inputs):

Expand Down Expand Up @@ -114,7 +114,7 @@ def test_source_detection_defaults(setup_inputs):
@pytest.mark.skipif(
os.environ.get("CI") == "true",
reason="Roman CRDS servers are not currently available outside the internal "
"network",
"network",
)
def test_source_detection_scalar_threshold(setup_inputs):

Expand Down Expand Up @@ -159,7 +159,7 @@ def test_source_detection_scalar_threshold(setup_inputs):
@pytest.mark.skipif(
os.environ.get("CI") == "true",
reason="Roman CRDS servers are not currently available outside the internal "
"network",
"network",
)
@pytest.mark.filterwarnings() # how to supress the no sources detected warning?
def test_coverage_mask(setup_inputs):
Expand Down Expand Up @@ -200,7 +200,7 @@ def test_coverage_mask(setup_inputs):
@pytest.mark.skipif(
os.environ.get("CI") == "true",
reason="Roman CRDS servers are not currently available outside the internal "
"network",
"network",
)
def test_outputs(setup_inputs):
"""Make sure `save_catalogs` and `output_cat_filetype` work correctly."""
Expand All @@ -224,7 +224,7 @@ def test_outputs(setup_inputs):
@pytest.mark.skipif(
os.environ.get("CI") == "true",
reason="Roman CRDS servers are not currently available outside the internal "
"network",
"network",
)
def test_limiting_catalog_size(setup_inputs):

Expand Down

0 comments on commit 8045c07

Please sign in to comment.