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 Nov 3, 2023
1 parent 712f82e commit 840584f
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions romancal/pipeline/exposure_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ def process(self, input):
if result.meta.exposure.type == "WFI_IMAGE":
if file_type == "asdf":
result.meta.cal_step.tweakreg = "SKIPPED"
#mc_result = ModelContainer(result)
# mc_result = ModelContainer(result)
mc_result = self.tweakreg([result])
if hasattr(ModelContainer(result),"_models") and mc_result._models:
if hasattr(ModelContainer(result), "_models") and mc_result._models:
result = mc_result._models.pop()
else:
result.meta.cal_step.tweakreg == "SKIPPED"
Expand All @@ -211,16 +211,22 @@ def setup_output(self, input):
"""Determine the proper file name suffix to use later"""
if input.meta.cal_step.tweakreg == "COMPLETE":
self.suffix = "cal"
#elif input.meta.cal_step.tweakreg == "SKIPPED" and input.meta.exposure.type == "WFI_IMAGE":
# elif input.meta.cal_step.tweakreg == "SKIPPED" and input.meta.exposure.type == "WFI_IMAGE":
# self.suffix = "sourcedetection"
elif input.meta.cal_step.tweakreg == "INCOMPLETE" and input.meta.exposure.type == "WFI_IMAGE":
elif (
input.meta.cal_step.tweakreg == "INCOMPLETE"
and input.meta.exposure.type == "WFI_IMAGE"
):
self.suffix = "sourcedetection"
elif input.meta.cal_step.tweakreg == "SKIPPED" and input.meta.exposure.type != "WFI_IMAGE":
elif (
input.meta.cal_step.tweakreg == "SKIPPED"
and input.meta.exposure.type != "WFI_IMAGE"
):
self.suffix = "cal"

if not self.steps["tweakreg"]["skip"]:
self.suffix = "cal"

if not self.steps['tweakreg']['skip']:
self.suffix = 'cal'

input.meta.filename = input.meta.filename.replace("uncal", self.suffix)
input["output_file"] = input.meta.filename
self.output_file = input.meta.filename
Expand Down

0 comments on commit 840584f

Please sign in to comment.