From b173863ee14d9328022b127c3c6de5034d79b527 Mon Sep 17 00:00:00 2001 From: Brett Date: Tue, 26 Nov 2024 13:09:47 -0500 Subject: [PATCH 1/2] turn exit calls into exceptions --- romancal/pipeline/mosaic_pipeline.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/romancal/pipeline/mosaic_pipeline.py b/romancal/pipeline/mosaic_pipeline.py index 8b31408a7..eca8d02dd 100644 --- a/romancal/pipeline/mosaic_pipeline.py +++ b/romancal/pipeline/mosaic_pipeline.py @@ -65,9 +65,7 @@ def process(self, input): # open the input file file_type = filetype.check(input) if file_type == "asdf": - log.info("The level three pipeline input needs to be an association") - exit(0) - return + raise TypeError("The level three pipeline input needs to be an association") if file_type == "asn": input = ModelLibrary(input, on_disk=self.on_disk) @@ -135,8 +133,9 @@ def process(self, input): self.sourcecatalog.output_file = self.output_file result_catalog = self.sourcecatalog.run(result) else: - log.info("resampling a mosaic file is not yet supported") - exit(0) + raise NotImplementedError( + "resampling a mosaic file is not yet supported" + ) else: self.resample.suffix = "coadd" From c2fa20f44f511bbee09fb76e9ee3fa657438f011 Mon Sep 17 00:00:00 2001 From: Brett Date: Tue, 26 Nov 2024 13:11:29 -0500 Subject: [PATCH 2/2] add changelog --- changes/1545.mosaic_pipeline.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/1545.mosaic_pipeline.rst diff --git a/changes/1545.mosaic_pipeline.rst b/changes/1545.mosaic_pipeline.rst new file mode 100644 index 000000000..cf6a70925 --- /dev/null +++ b/changes/1545.mosaic_pipeline.rst @@ -0,0 +1 @@ +Convert calls to ``exit(0)`` within the pipeline into exceptions.