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

JP-3728: Deprecate Step.__call__ #8761

Merged
merged 6 commits into from
Sep 26, 2024

Conversation

braingram
Copy link
Collaborator

@braingram braingram commented Sep 6, 2024

This PR adds a warning to Step.__call__ uses to target end-users that might use this expecting the step to use reference files.

Note that Step.__call__ is used in pipelines so the warning will only appear if Step.__call__ is used outside a pipeline (it's used on a step that doesn't have a "parent").

If Step.__call__ is removed, some decision will need to be made about what to do for pipeline uses of Step.__call__.

Regression tests show only failures that exist on main:
https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/1694/
and do not show the new warning (so there is no use of Step.__call__ (outside of a pipeline) in jwst.

Resolves JP-3728

Closes #8748

This PR addresses ...

Checklist for PR authors (skip items if you don't have permissions or they are not applicable)

  • added entry in CHANGES.rst within the relevant release section
  • updated or added relevant tests
  • updated relevant documentation
  • added relevant milestone
  • added relevant label(s)
  • ran regression tests, post a link to the Jenkins job below.
    How to run regression tests on a PR
  • All comments are resolved
  • Make sure the JIRA ticket is resolved properly

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.86%. Comparing base (eab0532) to head (758fd97).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8761   +/-   ##
=======================================
  Coverage   61.86%   61.86%           
=======================================
  Files         377      377           
  Lines       38911    38917    +6     
=======================================
+ Hits        24071    24077    +6     
  Misses      14840    14840           

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

@braingram braingram changed the title WIP: Deprecate Step.__call__ JP-3728: Deprecate Step.__call__ Sep 8, 2024
@braingram braingram marked this pull request as ready for review September 8, 2024 15:55
@braingram braingram requested a review from a team as a code owner September 8, 2024 15:55
@braingram
Copy link
Collaborator Author

Requested many reviewers as this will be discussed at the branch meeting tomorrow.

Copy link
Collaborator

@melanieclarke melanieclarke left a comment

Choose a reason for hiding this comment

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

As a self-contained change, this looks good to me. Testing locally, the warning is emitted when __call__ is used, and not when .call or .run is directly used. I don't see it from substeps when running a pipeline.

I think more work is needed to address the differences between .call and .run, but that's outside the scope of the request in JP-3728. I don't see anything wrong with deprecating __call__ in the meantime.

The change log edit needs to be converted to a towncrier fragment, and I'd like to wait to see if anyone else has opinions, so I'll hold off on approval for now.

Copy link
Contributor

@tapastro tapastro left a comment

Choose a reason for hiding this comment

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

I agree with Melanie that this change should do no harm and inform users about their use of a method we don't necessarily recommend. Just need the updates to changelog -> fragment, and I'll approve and merge.

@braingram
Copy link
Collaborator Author

Thanks @melanieclarke and @tapastro for taking a look. I updated the changelog to use towncrier.

@tapastro tapastro self-requested a review September 26, 2024 18:10
@tapastro tapastro merged commit 163ad08 into spacetelescope:main Sep 26, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print deprecation warning when neither .call nor .run is specified
4 participants