-
Notifications
You must be signed in to change notification settings - Fork 21
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
Remove assignment validation #417
Remove assignment validation #417
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #417 +/- ##
==========================================
- Coverage 97.56% 97.41% -0.15%
==========================================
Files 30 36 +6
Lines 2788 3294 +506
==========================================
+ Hits 2720 3209 +489
- Misses 68 85 +17 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
This comment was marked as outdated.
This comment was marked as outdated.
19aa07a
to
bd4e025
Compare
bd4e025
to
4cb17a3
Compare
I'm happy when you and William are. There's some magic in the current code where knowledge about how using dot notation triggers validation and dictionary notation does not, and a nice feature of this is that that magic will go away, I think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks, @braingram!
Just one question: will the validation still happen on saving the file?
Thanks! Yeah, asdf will always validate before saving (although roman_datamodels prevents this when "nuke validation is enabled allowing saving invalid files). |
4cb17a3
to
a61272d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Can you wait to merge until @WilliamJamieson approves?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are fine with me. More cleanup can probably be done but that is outside the scope of this PR.
This PR removes validation on attribute assignment for roman datamodels. This change was discussed during a recent roman calibration tag up and the consensus was that removing this feature will make handling TVAC data easier (and potentially older versions of files once RAD schemas/roman_datamodels are versioned).
With this PR we could consider removing "nuke_validation". The reasoning is that disabling
validate_on_read
now allows reading old/invalid files. Let's say I have a file "foo.asdf" withFOO_IMAGE
asexposure_type-1.0.0
. On roman_datamodels main if I try to open this file I get an error:On main disabling
validate_on_read
doesn't prevent this error since roman_datamodels will still validate each assignment. However, with this PR disablingvalidate_on_read
allows the file to be opened:Since this PR disables assignment validation there's no need to "nuke validation" for assignments. However there would still be a use for this feature if we want to be able to save invalid files.
If a user wants to write an invalid file I think it makes more sense for that file to not use RAD tags/schemas.
Regression tests https://github.com/spacetelescope/RegressionTests/actions/runs/11731951627
show one doctest failure due to the romancal docs testing assignment validation. This failure is addressed in spacetelescope/romancal#1504
Tasks
roman_datamodels
tests.docs/
page.no-changelog-entry-needed
.)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see below for change types).romancal
regression test (https://github.com/spacetelescope/RegressionTests/actions/workflows/romancal.yml) with this branch installed ("git+https://github.com/<fork>/rad@<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