Skip to content

Commit

Permalink
provide formatter to log_records (#1327)
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram authored Jul 25, 2024
2 parents 6dae8ac + 679bdac commit d4e2d88
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions romancal/stpipe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class RomanStep(Step):
output_ext = string(default='.asdf') # Default type of output
"""

_log_records_formatter = _LOG_FORMATTER

@classmethod
def _datamodels_open(cls, init, **kwargs):
"""
Expand Down Expand Up @@ -74,8 +76,8 @@ def finalize_result(self, model, reference_files_used):
model.meta.calibration_software_version = importlib.metadata.version("romancal")

if isinstance(model, (ImageModel, MosaicModel)):
for log_record in self.log_records:
model.cal_logs.append(_LOG_FORMATTER.format(log_record))
# convert to model.cal_logs type to avoid validation errors
model.cal_logs = type(model.cal_logs)(self.log_records)

if len(reference_files_used) > 0:
for ref_name, ref_file in reference_files_used:
Expand Down

0 comments on commit d4e2d88

Please sign in to comment.