Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 30, 2024
1 parent 4baa0e3 commit 2661712
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions romancal/dq_init/dq_init_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ def process(self, input):
# Create base ramp node with dummy values (for validation)
input_ramp = maker_utils.mk_ramp(shape=input_model.shape)
# check if the input model has a resultantdq from SDF
if hasattr(input_model, 'resultantdq'):
if hasattr(input_model, "resultantdq"):
input_ramp.groupdq = input_model.resultantdq.copy()

# Copy input_model contents into RampModel
for key in input_model.keys():
# check for resultantdq if present copy this to the emp
# it to the ramp model, we don't want to carry this around
if key != 'resultantdq':
if key != "resultantdq":
# If a dictionary (like meta), overwrite entires (but keep
# required dummy entries that may not be in input_model)
if isinstance(input_ramp[key], dict):
Expand Down
10 changes: 5 additions & 5 deletions romancal/dq_init/tests/test_dq_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def test_dqinit_resultantdq(instrument, exptype):
wfi_sci_raw.meta["guidestar"]["gw_window_xstart"] = 1012
wfi_sci_raw.meta["guidestar"]["gw_window_xsize"] = 16
wfi_sci_raw.meta.exposure.type = exptype
wfi_sci_raw.resultantdq[1,12,12] = dqflags.pixel["DROPOUT"]
wfi_sci_raw.resultantdq[1, 12, 12] = dqflags.pixel["DROPOUT"]
wfi_sci_raw.data = u.Quantity(
np.ones(shape, dtype=np.uint16), u.DN, dtype=np.uint16
)
Expand All @@ -325,14 +325,14 @@ def test_dqinit_resultantdq(instrument, exptype):
result = DQInitStep.call(wfi_sci_raw_model, override_mask=maskref_model)

# check that the resultantdq is present in the raw model
assert hasattr(wfi_sci_raw_model,'resultantdq')
assert hasattr(wfi_sci_raw_model, "resultantdq")
# check that the resultantdq is not copied to the result
assert not hasattr(result,'resultantdq')
assert not hasattr(result, "resultantdq")
# check to see the resultantdq is the correct shape
assert wfi_sci_raw_model.resultantdq.shape == shape
# check to see the resultantdq & groupdq have the correct value
assert wfi_sci_raw_model.resultantdq[1,12,12] == dqflags.pixel["DROPOUT"]
assert result.groupdq[1,12,12] == dqflags.pixel["DROPOUT"]
assert wfi_sci_raw_model.resultantdq[1, 12, 12] == dqflags.pixel["DROPOUT"]
assert result.groupdq[1, 12, 12] == dqflags.pixel["DROPOUT"]


@pytest.mark.parametrize(
Expand Down

0 comments on commit 2661712

Please sign in to comment.