diff --git a/src/stpipe/step.py b/src/stpipe/step.py index 5b29727f..8dc4ef3b 100644 --- a/src/stpipe/step.py +++ b/src/stpipe/step.py @@ -519,25 +519,10 @@ def run(self, *args): for idx, result in enumerate(results_to_save): if len(results_to_save) <= 1: idx = None - if isinstance(result, AbstractDataModel): - self.save_model(result, idx=idx, format=self.name_format) - elif hasattr(result, "save"): - try: - output_path = self.make_output_path( - idx=idx, name_format=self.name_format - ) - except AttributeError: - self.log.warning( - "`save_results` has been requested, but cannot" - " determine filename." - ) - self.log.warning( - "Specify an output file with `--output_file` or set" - " `--save_results=false`" - ) - else: - self.log.info("Saving file %s", output_path) - result.save(output_path, overwrite=True) + if not isinstance(result, AbstractDataModel): + # what has a "save"? Does anything ever reach this code + raise Exception(f"Something has a save: {result}") + self.save_model(result, idx=idx, format=self.name_format) if not self.skip: self.log.info("Step %s done", self.name)