Skip to content
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

Fix get_crds_parameters for ModelContainer #846

Merged
merged 2 commits into from
Aug 23, 2023

Conversation

WilliamJamieson
Copy link
Collaborator

Part of the purpose for ModelContainer.get_crds_parameters is so that stpipe can detect that a ModelContainer fits the description of a DataModel and that stpipe can then perform its actions on the ModelContainer object. It does this by checking the ModelContainer against: https://github.com/spacetelescope/stpipe/blob/6f84b52ffcce764a94806a35f5aefd28f3e8f8eb/src/stpipe/datamodel.py#L4-L68
However, this check only checks for the existence of these features: https://github.com/spacetelescope/stpipe/blob/6f84b52ffcce764a94806a35f5aefd28f3e8f8eb/src/stpipe/datamodel.py#L25-L29 not that they follow the template defined in stpipe in general.

Currently, ModelContainer.get_crds_parameters is defined as a property not a method which means it cannot be executed as a function. This is contrary to https://github.com/spacetelescope/stpipe/blob/6f84b52ffcce764a94806a35f5aefd28f3e8f8eb/src/stpipe/datamodel.py#L39-L45 defining it as a method.

This PR drops turning get_crds_parameters into a property.

Checklist

  • added entry in CHANGES.rst under the corresponding subsection
  • updated relevant tests
  • updated relevant documentation
  • updated relevant milestone(s)
  • added relevant label(s)

@WilliamJamieson WilliamJamieson requested a review from a team as a code owner August 22, 2023 13:49
@WilliamJamieson WilliamJamieson force-pushed the bugfix/get_crds_parameters branch from fa7b4c0 to 3bd3cc5 Compare August 22, 2023 13:53
@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01% ⚠️

Comparison is base (a530a0e) 76.00% compared to head (af5be2d) 75.99%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #846      +/-   ##
==========================================
- Coverage   76.00%   75.99%   -0.01%     
==========================================
  Files          96       96              
  Lines        5788     5787       -1     
==========================================
- Hits         4399     4398       -1     
  Misses       1389     1389              
Flag Coverage Δ *Carryforward flag
nightly 63.93% <ø> (ø) Carriedforward from a530a0e

*This pull request uses carry forward flags. Click here to find out more.

Files Changed Coverage Δ
romancal/datamodels/container.py 88.28% <ø> (-0.06%) ⬇️

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

Copy link
Collaborator

@nden nden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Copy link
Collaborator

@mairanteodoro mairanteodoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this, @WilliamJamieson!

@nden nden merged commit 440e4bb into spacetelescope:main Aug 23, 2023
@WilliamJamieson WilliamJamieson deleted the bugfix/get_crds_parameters branch August 24, 2023 03:42
mairanteodoro pushed a commit to mairanteodoro/romancal that referenced this pull request Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants