spacetelescope / stdatamodels

https://stdatamodels.readthedocs.io
Other
5 stars 24 forks source link

map JWST to OIFITS keywords prior to validate #234

Closed braingram closed 10 months ago

braingram commented 10 months ago

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

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

:loudspeaker: Thoughts on this report? Let us know!

rcooper295 commented 10 months ago

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