Skip to content

Commit

Permalink
Merge pull request #53 from tapastro/jp-2355-record-step-skips
Browse files Browse the repository at this point in the history
JP-2355: Attempt to record skip into cal_step using alias
  • Loading branch information
nden committed Jun 1, 2022
2 parents 9492298 + 4be1809 commit 04f7d47
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

- Update astropy min version to 5.0.4. [#52]

- Update datamodel with 'SKIPPED' status when step.skip set to True [#53]

0.3.3 (2022-04-07)
==================

Expand Down
8 changes: 7 additions & 1 deletion src/stpipe/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,12 @@ def run(self, *args):
# Run the Step-specific code.
if self.skip:
self.log.info('Step skipped.')
if isinstance(args[0], AbstractDataModel):
if self.class_alias is not None:
try:
args[0][f"meta.cal_step.{self.class_alias}"] = 'SKIPPED'
except AttributeError as e:
self.log.info(f"Could not record skip into DataModel header: {e}")
step_result = args[0]
else:
if self.prefetch_references:
Expand Down Expand Up @@ -779,7 +785,7 @@ def get_config_from_reference(cls, dataset, disable=None):
try:
model = cls._datamodels_open(dataset)
except (IOError, TypeError, ValueError):
logger.warning('Input dataset is not an instance of AbstractDataModel.')
logger.warning('Input dataset is not an instance of AbstractDataModel.')
disable = True

# Check if retrieval should be attempted.
Expand Down

0 comments on commit 04f7d47

Please sign in to comment.