avoid an extra validation on __init__ #356
Merged
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.
When a
SlitModel
is created from aMultiSlitModel.slits[i].instance
as is done inpixel_replace
:https://github.com/spacetelescope/jwst/blob/a32f8b01e8000603d6cc916511a87c0e0b77e47e/jwst/pixel_replace/pixel_replace.py#L187
The instance may contain the
int_times
FITS_rec and can lead to anAsdfConversionWarning
(that will soon be an error asdf-format/asdf#1858):https://github.com/spacetelescope/RegressionTests/actions/runs/11632063641/job/32394552214#step:28:266
This PR changes
Model.__init__
to avoid the validation on__init__
(which is also deprecated and soon be removed: asdf-format/asdf#1852). This avoids theAsdfConversionWarning
(due to an attempt to serialize a FITS_rec ) and has the added benefit of avoiding an unnecessary validation (the data will be validated on write where the FITS_rec will be safely converted).Regression tests: https://github.com/spacetelescope/RegressionTests/actions/runs/11666451738
all pass and most relevant to this PR show no
AsdfConversionWarning
.This change is similar to #230 in that it uses assignment to the private
_tree
attribute to avoid validation.Tasks
docs/
pageno-changelog-entry-needed
)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see below for change types)jwst
regression tests with this branch installed ("git+https://github.com/<fork>/stdatamodels@<branch>"
)news fragment change types...
changes/<PR#>.feature.rst
: new featurechanges/<PR#>.bugfix.rst
: fixes an issuechanges/<PR#>.doc.rst
: documentation changechanges/<PR#>.removal.rst
: deprecation or removal of public APIchanges/<PR#>.misc.rst
: infrastructure or miscellaneous change