Skip to content
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

map JWST to OIFITS keywords prior to validate #234

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

braingram
Copy link
Collaborator

@braingram braingram commented Nov 6, 2023

As reported by @rcooper295 using AmiOIModel.update results in a ValidationError. This is due to the mapping of JWST to OIFITS keywords only during AmiOIModel.on_save (which is not called during update).

This PR updates AmiOIModel to map JWST to OIFITS keywords before calling validate (which is called during update and also fixes an issue that without this PR AmiOIModel.validate would also similarly fail).

Unit tests were added to verify that AmiOIModel.update and AmiOIModel.validate run successfully for an OIFITS compliant model.

Regression tests run with no errors: https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1047/

Checklist

  • added entry in CHANGES.rst (either in Bug Fixes or Changes to API)
  • updated relevant tests
  • updated relevant documentation
  • updated relevant milestone(s)
  • added relevant label(s)

Copy link

codecov bot commented Nov 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
src/stdatamodels/jwst/datamodels/amioi.py 100.00% <100.00%> (+2.63%) ⬆️

📢 Thoughts on this report? Let us know!

@braingram braingram marked this pull request as ready for review November 6, 2023 22:43
@braingram braingram requested a review from a team as a code owner November 6, 2023 22:43
@rcooper295
Copy link
Contributor

I tested the changes and they fixed the ValidationWarning I encountered when trying to use AmiOIModel.update. Thanks Brett!

Copy link
Collaborator

@nden nden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@braingram braingram merged commit f3aa87e into spacetelescope:master Nov 7, 2023
@braingram braingram deleted the oifits_update branch November 7, 2023 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants