-
Notifications
You must be signed in to change notification settings - Fork 26
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
Warn during Step.run
when the step hasn't been configured from CRDS
#198
base: main
Are you sure you want to change the base?
Conversation
Step.run
when the step hasn't been configured from CRDS
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #198 +/- ##
===========================================
+ Coverage 75.26% 94.86% +19.59%
===========================================
Files 34 37 +3
Lines 2689 3153 +464
===========================================
+ Hits 2024 2991 +967
+ Misses 665 162 -503 ☔ View full report in Codecov by Sentry. |
61f62ac
to
dbb177c
Compare
@melanieclarke what do you think about this as an alternative to #192 ? |
I think this approach solves only one of several problems with the current design of In addition, this approach preserves some of the most awkward features of call and run usage: that user-provided parameters can only be set consistently and with full validation if they are provided before the step is instantiated. With #192, it is possible to directly provide an override at run time, as well as fully merging in all other sources of possible parameter defaults, at the point when all inputs are available. If we do not provide a way to update parameters after instantiation that respects priority order for overrides, then we can’t deprecate The only advantage I see to this PR is that it is a simpler change. I think if #192 or similar approaches are not acceptable, then this is better than nothing. |
Thanks!
I agree that when executing a
Thanks. Yes this PR does not try to introduce any breaking changes to
I'll follow up on #192. The approach of this PR is to reinforce the documented API until we have a more complete plan for what we want in a new API. |
This PR adds a warning that will appear in the console and step log when a step is called without configuring the step from CRDS. For example:
This warning is controlled by a new Step attribute
_warn_on_missing_crds_steppars
which will allow each calibration pipeline to control this behavior either for all steps or for only steps that have parameter files. This currently defaults toFalse
(but is additionally set toFalse
in the test Step classes used in the unit tests here because they inherit from jwst steps, by re-setting the default in the test classes this will allow jwst to set this flag for the baseJwstStep
without breaking the tests here).For
Step.run
uses where the warning is problematic the user has 2 options, set_warn_on_missing_crds_steppars=False
on the instance or filter the warning (using either pytest or the warnings standard library).jwst regtests (with context 1996): https://github.com/spacetelescope/RegressionTests/actions/runs/11298896541
show only the 5 expected tests due to different results from jenkins and no
NoCRDSParameterWarning
romancal regtests: https://github.com/spacetelescope/RegressionTests/actions/runs/11297976103
only unrelated failures and no
NoCRDSParameterWarning
Tasks
docs/
pageno-changelog-entry-needed
)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see below for change types)"git+https://github.com/<fork>/stpipe@<branch>"
)jwst
regression testromancal
regression testnews fragment change types...
changes/<PR#>.feature.rst
: new featurechanges/<PR#>.bugfix.rst
: fixes an issuechanges/<PR#>.doc.rst
: documentation changechanges/<PR#>.removal.rst
: deprecation or removal of public APIchanges/<PR#>.misc.rst
: infrastructure or miscellaneous change