Skip to content

Update tag handling and clean up Builder API#660

Open
WilliamJamieson wants to merge 3 commits intospacetelescope:mainfrom
WilliamJamieson:refactor/builder_api
Open

Update tag handling and clean up Builder API#660
WilliamJamieson wants to merge 3 commits intospacetelescope:mainfrom
WilliamJamieson:refactor/builder_api

Conversation

@WilliamJamieson
Copy link
Copy Markdown
Contributor

There has been something about how stnode objects handle the setting and removal of the tags that ASDF (or users) can attach to nodes that has been bothering me for a long time, see

# TODO: Add method for setting read_tag with some checks
.

This PR attempts to resolve this by adding a constructor to the nodes that takes care of this issue. This in turn means that all the code of the form

if tag:
    new._read_tag = tag

return new

could be rolled together. Note that while fixing this issue I noticed/found some small issues with the Builder/create_* API that could be improved. This PR resolves both the _read_tag and builder API stuff.

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

❌ Patch coverage is 96.77419% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.33%. Comparing base (087a60d) to head (7e6009d).
⚠️ Report is 255 commits behind head on main.

Files with missing lines Patch % Lines
src/roman_datamodels/_stnode/_converters.py 66.66% 1 Missing ⚠️
src/roman_datamodels/_stnode/_registry.py 50.00% 1 Missing ⚠️
src/roman_datamodels/_stnode/_schema.py 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #660      +/-   ##
==========================================
- Coverage   97.56%   95.33%   -2.23%     
==========================================
  Files          30       27       -3     
  Lines        2788     2785       -3     
==========================================
- Hits         2720     2655      -65     
- Misses         68      130      +62     

☔ 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.

@WilliamJamieson WilliamJamieson marked this pull request as ready for review April 30, 2026 13:12
@WilliamJamieson WilliamJamieson requested a review from a team as a code owner April 30, 2026 13:12
@WilliamJamieson
Copy link
Copy Markdown
Contributor Author

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.

1 participant