-
Notifications
You must be signed in to change notification settings - Fork 32
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
Adjust style checks to align with jwst #295
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #295 +/- ##
==========================================
+ Coverage 86.38% 86.89% +0.51%
==========================================
Files 49 49
Lines 8899 8891 -8
==========================================
+ Hits 7687 7726 +39
+ Misses 1212 1165 -47 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
@kmacdonald-stsci Any advice on how to handle the bugs revealed by these style checks? Can What is the expected definition of |
I have a few The stcal/src/stcal/ramp_fitting/likely_fit.py Line 493 in 787aa81
|
Thanks!
I added a noqa for this line. It will however continue to fail if used.
Since likely_fit imports likely_algo_classes:
I think the import of fit_ramps needs to be local to avoid a circular import error. I updated the PR to include the local import.
|
@kmacdonald-stsci any suggestions for a second reviewer? Most of the changes are code style but the duplicate jump test might be worth checking with a maintainer of that code to see if the duplicate is supposed to be different. |
For anything in STCAL, if you need an additional reviewer besides me, I think you can always tag @melanieclarke and/or @tapastro. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One lingering fix, for the f-string in the log message, but otherwise this looks good.
Thanks for doing this clean up work!
Thanks for the quick review @melanieclarke Let me know how the jwst checks evolve and we can update these as well. |
84dbac6
to
60138a4
Compare
60138a4
to
5d543d9
Compare
dd847cc
to
0182778
Compare
0182778
to
f74ccc9
Compare
Closing as this PR has already fallen out of date (the modified style checks are violated with recent PRs) and there doesn't seem to be enough interest in this change to get the required second review. |
This PR adjusts the style checks to roughly align with jwst (with a few adjustments for things like this package using cython).
For reference the ruff checks and pre-commit hooks for jwst are as follows:
https://github.com/spacetelescope/jwst/blob/e5c73fa23d157f4aa65416b4070c2b838e978494/pyproject.toml#L254
https://github.com/spacetelescope/jwst/blob/dd76184e82c1e863bce22d02de093f9bfe12f16f/.github/workflows/ci.yml
This PR sets the checks in this repo to roughly align:
I applied auto-fixes in:
a85bd00
These are largely import sorting but I think it's worth a second set of eyes on these changes as I did notice one log message formatting change that likely indicates a bug in the log message (where it's currently not formatting the expected variable):
a85bd00#diff-c04284467dcbe86296aa89b83fd434e0dde8a32d790d157a9588ba3c7d169484R264
I then did some manual fixes removing unused variables and a duplicate test in:
3c59de9
There are still failures with this PR that I'm not sure how to address.
2 are uses of an undefined
fit_ramps
inlikely_algo_classes.py
:stcal/src/stcal/ramp_fitting/likely_algo_classes.py
Line 289 in 787aa81
These would crash if anything tried to execute that code.
The last one is the use of an undefined
cube
indbg_print_cube
(which is unused). Calling this function would crash.Tasks
docs/
pageno-changelog-entry-needed
)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see below for change types)"git+https://github.com/<fork>/stcal@<branch>"
)jwst
regression testromancal
regression testnews fragment change types...
changes/<PR#>.apichange.rst
: change to public APIchanges/<PR#>.bugfix.rst
: fixes an issuechanges/<PR#>.general.rst
: infrastructure or miscellaneous change