From eaed1362c2ac61137aa73a28ac9f5da335b879cf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 27 Oct 2023 19:08:20 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- romancal/pipeline/exposure_pipeline.py | 19 +++++++++++-------- romancal/regtest/test_wfi_pipeline.py | 26 +++++++++++++------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/romancal/pipeline/exposure_pipeline.py b/romancal/pipeline/exposure_pipeline.py index 1df5f31e1..5fbaf652b 100644 --- a/romancal/pipeline/exposure_pipeline.py +++ b/romancal/pipeline/exposure_pipeline.py @@ -9,9 +9,11 @@ # step imports from romancal.assign_wcs import AssignWcsStep -#from romancal.associations.exceptions import AssociationNotValidError -#from romancal.associations.load_as_asn import LoadAsLevel2Asn + +# from romancal.associations.exceptions import AssociationNotValidError +# from romancal.associations.load_as_asn import LoadAsLevel2Asn from romancal.dark_current import DarkCurrentStep +from romancal.datamodels import ModelContainer from romancal.dq_init import dq_init_step from romancal.flatfield import FlatFieldStep from romancal.jump import jump_step @@ -24,7 +26,6 @@ from romancal.saturation import SaturationStep from romancal.source_detection import SourceDetectionStep from romancal.tweakreg import TweakRegStep -from romancal.datamodels import ModelContainer from ..stpipe import RomanPipeline @@ -151,14 +152,16 @@ def process(self, input): result = self.jump(result) result = self.rampfit(result) result = self.assign_wcs(result) - + if result.meta.exposure.type == "WFI_IMAGE": result = self.flatfield(result) result = self.photom(result) result = self.source_detection(result) - if (file_type == "asn"): + if file_type == "asn": tweakreg_input.append(result) - log.info(f"Number of models to tweakreg: {len(tweakreg_input._models), n_members}") + log.info( + f"Number of models to tweakreg: {len(tweakreg_input._models), n_members}" + ) else: log.info("Flat Field step is being SKIPPED") log.info("Photom step is being SKIPPED") @@ -182,11 +185,11 @@ def process(self, input): if file_type == "asdf": mc_result = self.tweakreg([result]) result = mc_result._models.pop() - if file_type == "asn" : + if file_type == "asn": result = self.tweakreg(tweakreg_input) log.info("Roman exposure calibration pipeline ending...") - + return results def setup_output(self, input): diff --git a/romancal/regtest/test_wfi_pipeline.py b/romancal/regtest/test_wfi_pipeline.py index 26447e1bf..93cae8ee3 100644 --- a/romancal/regtest/test_wfi_pipeline.py +++ b/romancal/regtest/test_wfi_pipeline.py @@ -357,19 +357,19 @@ def test_level2_grism_processing_pipeline(rtdata, ignore_asdf_paths): assert model.meta.cal_step.saturation == "COMPLETE" pipeline.log.info( - "DMS278 MSG: Testing WFI Level 2 Data Generation - Spectroscopy in Level 2 spectroscopic" - " output......." + passfail(model.meta.cal_step.dq_init == "COMPLETE") + - passfail(model.meta.cal_step.saturation == "COMPLETE" )+ - passfail(model.meta.cal_step.refpix == "COMPLETE") + - passfail(model.meta.cal_step.linearity == "COMPLETE") + - passfail(model.meta.cal_step.jump == "COMPLETE") + - passfail(model.meta.cal_step.ramp_fit == "COMPLETE") + - passfail(model.meta.cal_step.assign_wcs == "COMPLETE") + - passfail(model.meta.cal_step.flat_field == "SKIPPED") + - passfail(model.meta.cal_step.photom == "SKIPPED") + - passfail(model.meta.cal_step.source_detection == "SKIPPED") + - passfail(model.meta.cal_step.tweakreg == "SKIPPED") - + "DMS278 MSG: Testing WFI Level 2 Data Generation - Spectroscopy in Level 2 spectroscopic" + " output......." + + passfail(model.meta.cal_step.dq_init == "COMPLETE") + + passfail(model.meta.cal_step.saturation == "COMPLETE") + + passfail(model.meta.cal_step.refpix == "COMPLETE") + + passfail(model.meta.cal_step.linearity == "COMPLETE") + + passfail(model.meta.cal_step.jump == "COMPLETE") + + passfail(model.meta.cal_step.ramp_fit == "COMPLETE") + + passfail(model.meta.cal_step.assign_wcs == "COMPLETE") + + passfail(model.meta.cal_step.flat_field == "SKIPPED") + + passfail(model.meta.cal_step.photom == "SKIPPED") + + passfail(model.meta.cal_step.source_detection == "SKIPPED") + + passfail(model.meta.cal_step.tweakreg == "SKIPPED") ) assert model.meta.cal_step.dq_init == "COMPLETE" assert model.meta.cal_step.saturation == "COMPLETE"