-
Notifications
You must be signed in to change notification settings - Fork 167
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
Review jwst code for step.skip usage #8498
Comments
Comment by Melanie Clarke on JIRA: This issue was noted by Howard Bushouse in review for tweakreg and outlier_detection updates. Howard, please edit or comment to clarify as needed. |
Comment by Howard Bushouse on JIRA: I'm guessing that when |
I can confirm Line 110 in 380dc5e
can be removed. It is unnecessary, but also it should not have any bad effect, as this function is called at the end of a step, and step instances should not be reused. This method updates the equivalent of the PRIMARY header, so it by definition should only be called once per datamodel (FITS file), though it should be able to be called on N times for steps that output N datamodels. |
Comment by Ned Molter on JIRA: Noting here the places where I find direct setting of self.skip within a step:
And here the places where I find record_step_status:
As a random aside, the record_step_status function seems a bit underutilized, and I'm sure there are instances where this could (should?) be used to e.g. set the metadata attributes for all the slits in a MultiSlitModel. I guess that change would be low-priority and beyond the scope of this PR, but still |
Comment by Ned Molter on JIRA: In addition, the pipeline codes are checking whether the step.skip attribute was set to True after the step had been run for master_background and cube_build. With the change that removes setting of that attribute within the step, these checks need to be changed to checks of the meta.step.skipped metadata of the result instead. |
Melanie Clarke This ticket is current set to RTT, but I'm unclear what testing can be performed or what if any work remains? |
Comment by Melanie Clarke on JIRA: Fixed by #8600 |
Comment by Melanie Clarke on JIRA: Thanks for pointing this out. This was more of an internal refactoring, so no additional specific tests should be needed from INS. |
Issue JP-3631 was created on JIRA by Melanie Clarke:
Steps defined in stpipe always have a 'skip' attribute; when this is set to True, the step is skipped. This is available to users as a top-level parameter for each step.
The skip attribute should rarely be set by code within a pipeline step, since it may have unintended consequences. For example, currently, when the outlier_detection step is run on NIRSpec MOS data, if skip is set for one slit, the step is then skipped for all subsequent slits. This fix is addressed in the PR for JP-2922. A similar fix for the tweakreg step is addressed in PR 8476 (https://github.com/spacetelescope/jwst/pull/8476).
We should review remaining steps for similar issues and make sure that the skip attribute is only set by the user or at the pipeline level, not internal to any step. In particular, it looks like skip is set to True in the core class JwstStep when record_step_status is called with success=False. This function should probably either be deprecated or updated to avoid setting skip directly.
The text was updated successfully, but these errors were encountered: