-
Notifications
You must be signed in to change notification settings - Fork 181
JP-3930: Make sure input is not modified inside Steps #9725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
6170a7c
Smoke tests for ami, assign_wcs, badpix_selfcal, barshadow
melanieclarke 5b7f088
Smoke tests for charge_migration, clean_flicker_noise, combine_1d
melanieclarke d0c1988
Smoke tests for cube_build, dark_current
melanieclarke df3ad45
Fix some shallow copies; better tests for input modification
melanieclarke 83cf2eb
Fix shallow copy for dq_init; fix uninitialized value error; add tests
melanieclarke 1b4ff3b
Fix shallow copy for emicorr; add tests
melanieclarke 331336e
Fix shallow copy for extract_1d; add tests
melanieclarke 76f4317
Fix shallow copy for extract_2d; fix minor logic errors; add tests
melanieclarke 7feea4c
Fix shallow copy for firstframe; add tests
melanieclarke 035b03d
Smoke tests for flatfield, fringe
melanieclarke 602a6ad
Fix shallow copy for gain_scale; add tests
melanieclarke 632e663
Fix shallow copy for group_scale; add tests
melanieclarke de183f0
Fix cube_build test
melanieclarke caf9d21
Add reference files to GuiderCdsStep; fix shallow copy; add tests
melanieclarke 0e5895e
Add smoke tests for imprint
melanieclarke 35e2382
Fix shallow copy for ipc; add tests
melanieclarke ebf5df0
Fix shallow copy for jump; add tests
melanieclarke 5d43d3a
Fix shallow copy for lastframe; add tests
melanieclarke e48e7ce
Fix shallow copy for linearity; add tests
melanieclarke 7a87d74
Fix shallow copy for master_background_mos; add tests
melanieclarke cc06dd3
Fix shallow copy for msaflagopen; add tests
melanieclarke df91aaf
Add smoke tests for pathloss
melanieclarke c05e27b
Reorganize extract_1d test data
melanieclarke 222abc0
Fix shallow copy for persistence; fix intermediate save override; add…
melanieclarke 5c9d02f
Fix photom shallow copy; skip step for unexpected type; close input_m…
melanieclarke 94b3179
Fix shallow copy for pixel_replace; add tests
melanieclarke a210c0b
Smoke tests for ramp_fit, refpix
melanieclarke ec75086
Fix shallow copy for resample, reset, residual_fringe, rscd; add smok…
melanieclarke 9a890aa
Fix shallow copy for saturation; add tests
melanieclarke 2aba9b5
Add smoke test for source_catalog
melanieclarke 6183442
Fix shallow copy for spectral_leak; add smoke tests
melanieclarke 974bfca
Fix shallow copy in srctype; remove unreachable code; add smoke tests
melanieclarke 42a306f
Add smoke tests for straylight
melanieclarke 1cccb51
Fix shallow copy for superbias and wavecorr; add tests
melanieclarke d9138ec
Smoke tests for wfs_combine
melanieclarke 720216f
Fix shallow copy for wfss_contam; add smoke test
melanieclarke 8c0bfbc
Smoke tests for white_light
melanieclarke 71f3bad
Minor clean up
melanieclarke 317d26b
Add change log
melanieclarke 45d7933
Bump minimum asdf to avoid warnings for ref files
melanieclarke 4e9d769
Clean up assign_wcs tests
melanieclarke f1aa533
Minor clean up
melanieclarke 029086e
Use 'with' to open datamodel in resample_spec
melanieclarke b3376e7
Merge branch 'main' into jp-3930
tapastro bdbcd87
Merge branch 'main' into jp-3930
melanieclarke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Ensure that all steps do not modify input datamodels. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| """Test the AssignWCSStep.""" | ||
|
|
||
| import numpy as np | ||
| from stdatamodels.jwst import datamodels | ||
|
|
||
| from jwst.assign_wcs import AssignWcsStep | ||
| from jwst.assign_wcs.tests.test_miri import create_hdul as create_miri | ||
| from jwst.assign_wcs.tests.test_nircam import create_hdul as create_nircam | ||
| from jwst.assign_wcs.tests.test_niriss import create_hdul as create_niriss | ||
|
|
||
|
|
||
| def test_assign_wcs_step_miri_ifu(): | ||
| hdul = create_miri(detector="MIRIFULONG", channel="34", band="MEDIUM") | ||
| model = datamodels.CubeModel(hdul) | ||
| model.data = np.zeros((3, 40, 50)) | ||
| result = AssignWcsStep.call(model) | ||
| assert result is not model | ||
| assert result.meta.cal_step.assign_wcs == "COMPLETE" | ||
| assert model.meta.cal_step.assign_wcs is None | ||
|
|
||
|
|
||
| def test_assign_wcs_step_nis_wfss(): | ||
| hdul = create_niriss(filtername="GR150R", pupil="F200W", exptype="NIS_WFSS") | ||
| model = datamodels.ImageModel(hdul) | ||
| result = AssignWcsStep.call(model) | ||
| assert result is not model | ||
| assert result.meta.cal_step.assign_wcs == "COMPLETE" | ||
| assert model.meta.cal_step.assign_wcs is None | ||
|
|
||
|
|
||
| def test_assign_wcs_step_nrc_wfss(): | ||
| hdul = create_nircam(exptype="NRC_WFSS", filtername="F444W", pupil="GRISMR") | ||
| model = datamodels.ImageModel(hdul) | ||
| result = AssignWcsStep.call(model) | ||
| assert result is not model | ||
| assert result.meta.cal_step.assign_wcs == "COMPLETE" | ||
| assert model.meta.cal_step.assign_wcs is None | ||
|
|
||
|
|
||
| def test_unsupported_input(caplog): | ||
| model = datamodels.SlitModel() | ||
| result = AssignWcsStep.call(model) | ||
| assert result is not model | ||
| assert "type is not supported" in caplog.text | ||
| assert result.meta.cal_step.assign_wcs == "SKIPPED" | ||
| assert model.meta.cal_step.assign_wcs is None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.