Skip to content

Deprecate DataModel in favor of JwstDataModel#676

Draft
emolter wants to merge 3 commits into
spacetelescope:mainfrom
emolter:consolidate-datamodels
Draft

Deprecate DataModel in favor of JwstDataModel#676
emolter wants to merge 3 commits into
spacetelescope:mainfrom
emolter:consolidate-datamodels

Conversation

@emolter

@emolter emolter commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Closes #581

This PR combines DataModel with JwstDataModel and deprecates DataModel.

In this version the code for JwstDataModel would live at src/stdatamodels/model_base.py but available to be imported as both from stdatamodels import JwstDataModel and from stdatamodels.jwst.datamodels import JwstDataModel. The latter is widely used already.

Requires spacetelescope/jwst#10288 to fix one instance where the pipeline was doing from stdatamodels.jwst.datamodels.model_base import JwstDataModel. This construction would no longer work, but since it's (hopefully) not in wide use that should be ok.

Tasks

  • update or add relevant tests
  • update relevant docstrings and / or docs/ page
  • Does this PR change any API used downstream? (if not, label with no-changelog-entry-needed)
    • write news fragment(s) in changes/: echo "changed something" > changes/<PR#>.<changetype>.rst (see below for change types)
    • run jwst regression tests with this branch installed ("git+https://github.com/<fork>/stdatamodels@<branch>")
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

codecov Bot commented Feb 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.36%. Comparing base (4a769a6) to head (4d64a17).
⚠️ Report is 82 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #676      +/-   ##
==========================================
- Coverage   90.44%   90.36%   -0.09%     
==========================================
  Files          99       98       -1     
  Lines        4690     4692       +2     
==========================================
- Hits         4242     4240       -2     
- Misses        448      452       +4     

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

@emolter emolter requested a review from tapastro February 27, 2026 15:39
@emolter

emolter commented Feb 27, 2026

Copy link
Copy Markdown
Contributor Author

@tapastro this is still in the investigation phase. It'd be helpful to get your take on whether we want to do this, i.e., do the benefits (code and docs readability/maintainability, clarity on intended base class for downstream use) outweigh the potential for disrupting people's code downstream that might be using DataModel? Do we need to get additional opinions from the various stakeholders about this?

@emolter emolter force-pushed the consolidate-datamodels branch from 8f82c47 to 4d64a17 Compare February 27, 2026 17:29
@emolter

emolter commented Feb 27, 2026

Copy link
Copy Markdown
Contributor Author

Perhaps relevant to this PR, LIGER evidently uses DataModel: oirlab/liger_iris_pipeline#101 (comment)

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.

Combine DataModel and JwstDataModel

1 participant