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-3729: report jwst version at end of Step.run #8769

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

braingram
Copy link
Collaborator

@braingram braingram commented Sep 10, 2024

This is a second attempt at logging the jwst version at the end of pipeline/step runs. The first attempt was subject to a stpipe bug which will need to be separately addressed.

This PR wraps Step.run to log the version at the end of a run for a step that has no parent. This is similar to the previous attempt #8760 but does not use finalize_result (as that is called incorrectly by stpipe).

Testing with strun nsclean abcdefg (to make sure this works around the stpipe bug: spacetelescope/stpipe#188) gives:

2024-09-10 14:05:12,152 - stpipe - WARNING - Input dataset is not an instance of AbstractDataModel.
2024-09-10 14:05:12,152 - stpipe - INFO - PARS-NSCLEANSTEP: CRDS parameter reference retrieval disabled.
2024-09-10 14:05:12,154 - stpipe.NSCleanStep - INFO - NSCleanStep instance created.
2024-09-10 14:05:12,198 - stpipe.NSCleanStep - INFO - Step NSCleanStep running with args ('abcdefg',).
2024-09-10 14:05:12,200 - stpipe.NSCleanStep - INFO - Step NSCleanStep parameters are:
  pre_hooks: []
  post_hooks: []
  output_file: None
  output_dir: None
  output_ext: .fits
  output_use_model: False
  output_use_index: True
  save_results: True
  skip: True
  suffix: None
  search_output_file: True
  input_dir: ''
  mask_spectral_regions: True
  n_sigma: 5.0
  save_mask: False
  user_mask: None
2024-09-10 14:05:12,200 - stpipe.NSCleanStep - INFO - Step skipped.
2024-09-10 14:05:12,200 - stpipe - INFO - Results used jwst version: 1.15.2.dev237+gf252448ee

Resolves JP-3729

Tasks

  • request a review from someone specific, to avoid making the maintainers review every PR
  • add a build milestone, i.e. Build 11.3 (use the latest build if not sure)
  • Does this PR change user-facing code / API?
    • add an entry to CHANGES.rst within the relevant release section (otherwise add the no-changelog-entry-needed label to this PR)
    • update or add relevant tests
    • update relevant docstrings and / or docs/ page
    • start a regression test and include a link to the running job (click here for instructions)
      • Do truth files need to be updated ("okified")?
        • after the reviewer has approved these changes, run okify_regtests to update the truth files
  • if a JIRA ticket exists, make sure it is resolved properly

@braingram braingram marked this pull request as ready for review September 10, 2024 18:10
@braingram braingram requested a review from a team as a code owner September 10, 2024 18:10
@braingram braingram changed the title report jwst version at end of Step.run JP-3729: report jwst version at end of Step.run Sep 10, 2024
Copy link

codecov bot commented Sep 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.85%. Comparing base (2aa4c18) to head (8f6814f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8769   +/-   ##
=======================================
  Coverage   60.84%   60.85%           
=======================================
  Files         373      373           
  Lines       38654    38657    +3     
=======================================
+ Hits        23518    23523    +5     
+ Misses      15136    15134    -2     

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

@melanieclarke
Copy link
Collaborator

Testing with single steps (skipped and not skipped) and with whole pipelines, it looks like this works. It is a little different from the previous implementation -- the log message comes from stpipe instead of from the step or pipeline interface, and it's printed at the end instead of next to the CRDS context message. Is that okay, @drlaw1558?

@braingram braingram requested a review from drlaw1558 September 10, 2024 19:23
Copy link
Collaborator

@drlaw1558 drlaw1558 left a comment

Choose a reason for hiding this comment

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

LG2M, print location should be fine.

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.

Thanks for the fix!

@braingram braingram merged commit 425b227 into spacetelescope:master Sep 10, 2024
29 checks passed
@braingram braingram deleted the report_on_run_finish branch September 10, 2024 20:34
@nden nden added this to the Build 11.1 milestone Sep 17, 2024
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.

4 participants