Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@braingram
Copy link
Collaborator

@braingram braingram commented Oct 10, 2025

Fixes: #581
Fixes: #580

This PR changes how nodes wrap/unwrap values:

With the PR old models can be made:

>> m = rdm.ImageModel.create_fake_data(tag="asdf://stsci.edu/datamodels/roman/tags/wfi_image-1.0.0")
>> m.validate()  # fails on main
>> m.save("foo.asdf")  # works with this PR

However if a user modifies an old model they will need to wrap values.

>> type(m.meta.filename)
roman_datamodels.stnode.Filename
>> m.meta.filename = "foo"
>> m.validate()
Failed validating 'tag' in schema['properties']['meta']['allOf'][0]['allOf'][0]['properties']['filename']:
>> m.meta.filename = stnode.Filename("foo")
>> m.validate()  # succeeds

Regtests: https://github.com/spacetelescope/RegressionTests/actions/runs/18410870474
show 11 differences all from tag differences for meta.filename where:

  • for tvac input pipeline runs meta.filename is now the expected str
  • for non-tvac runs meta.filename is the type that was provided as an input. As we have some uncal files with Filename instead of str. I suggest that we regenerate the regtest files. Perhaps we want to wait until we ferret out a few more tagged node uses in romancal. However if that work takes longer than review of this PR I suggest we regenerate the files with this PR.

Tasks

  • Update or add relevant roman_datamodels tests.
  • Update relevant docstrings and / or docs/ page.
  • Does this PR change any API used downstream? (If not, label with no-changelog-entry-needed.)
News fragment change types:
  • changes/<PR#>.feature.rst: new feature
  • changes/<PR#>.bugfix.rst: fixes an issue
  • changes/<PR#>.doc.rst: documentation change
  • changes/<PR#>.removal.rst: deprecation or removal of public API
  • changes/<PR#>.misc.rst: infrastructure or miscellaneous change

@braingram braingram changed the title No wrap Remove scalar node wrapping and fix DNode/LNode wrapping Oct 10, 2025
@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.03%. Comparing base (087a60d) to head (3f7600e).
⚠️ Report is 201 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #587      +/-   ##
==========================================
- Coverage   97.56%   95.03%   -2.53%     
==========================================
  Files          30       41      +11     
  Lines        2788     4233    +1445     
==========================================
+ Hits         2720     4023    +1303     
- Misses         68      210     +142     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@braingram braingram force-pushed the no_wrap branch 2 times, most recently from 07e933e to ebdeb37 Compare October 10, 2025 16:18
@braingram braingram marked this pull request as ready for review October 10, 2025 18:16
@braingram braingram requested a review from a team as a code owner October 10, 2025 18:16
@braingram braingram requested a review from PaulHuwe October 10, 2025 18:19
Copy link
Collaborator

@PaulHuwe PaulHuwe 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
Copy link
Collaborator Author

Started a fresh regtest run for okifying: https://github.com/spacetelescope/RegressionTests/actions/runs/18497285195
Once that finishes we can merge and okify the differences.

@braingram
Copy link
Collaborator Author

Merging and okifying the differences.

@braingram braingram merged commit 8b8ae9a into spacetelescope:main Oct 14, 2025
20 of 21 checks passed
@braingram braingram deleted the no_wrap branch October 14, 2025 13:37
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.

Assigning m.meta to m.meta leads to validation errors remove scalar node wrapping

3 participants