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 Jul 3, 2024
1 parent 08fcb73 commit af7834d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
6 changes: 4 additions & 2 deletions romancal/datamodels/filetype.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
import os
from pathlib import Path
from typing import Union

import roman_datamodels as rdm

from romancal.datamodels import ModelContainer


Expand Down Expand Up @@ -45,10 +47,10 @@ def check(init: Union[os.PathLike, Path, io.FileIO]) -> str:
return ext
elif isinstance(init, rdm.DataModel):
return "DataModel"

elif isinstance(init, ModelContainer):
return "ModelContainer"

elif hasattr(init, "read") and hasattr(init, "seek"):
magic = init.read(5)
init.seek(0, 0)
Expand Down
8 changes: 4 additions & 4 deletions romancal/pipeline/exposure_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ def process(self, input):
# extract the members from the asn to run the files through the steps
results = ModelContainer()
tweakreg_input = ModelContainer()
if file_type == 'asn':
if file_type == "asn":
for product in asn["products"]:
n_members = len(product["members"])
for member in product["members"]:
expos_file.append(member["expname"])

#results = ModelContainer()
#tweakreg_input = ModelContainer()
# results = ModelContainer()
# tweakreg_input = ModelContainer()
for in_file in expos_file:
if isinstance(in_file, str):
input_filename = basename(in_file)
Expand All @@ -112,7 +112,7 @@ def process(self, input):

# check to see if in_file is defined, if not assume we have a datamodel
if in_file is not None:
# Open the file
# Open the file
input = rdm.open(in_file)
log.info(f"Processing a WFI exposure {in_file}")

Expand Down
11 changes: 5 additions & 6 deletions romancal/regtest/test_wfi_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,19 +489,18 @@ def test_elp_input_dm(rtdata, ignore_asdf_paths):
rtdata.get_data(f"WFI/image/{input_data}")
dm_input = rdm.open(rtdata.input)

# Test Pipeline with input datamodel
# Test Pipeline with input datamodel
output = "r0000101001001001001_01101_0001_WFI01_cal.asdf"
rtdata.output = output
ExposurePipeline.call(dm_input, save_results = True)
ExposurePipeline.call(dm_input, save_results=True)
rtdata.get_truth(f"truth/WFI/image/{output}")

# check that the file exists ( don't duplicate checking contents done above)
pipeline = ExposurePipeline()
pipeline.log.info(
"Check that the output file exists "
+ passfail(os.path.isfile(rtdata.output))
)

"Check that the output file exists " + passfail(os.path.isfile(rtdata.output))
)

# Ensure step completion is as expected
model = rdm.open(rtdata.output)

Expand Down

0 comments on commit af7834d

Please sign in to comment.