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

Align style checks with jwst #383

Merged
merged 61 commits into from
Feb 3, 2025
Merged

Conversation

braingram
Copy link
Collaborator

@braingram braingram commented Jan 29, 2025

spacetelescope/jwst#9081 introduced major changes to the code style checks in jwst.

Since this package primarily serves jwst this PR updates the style checks here to more closely match those in jwst.

Regtests: https://github.com/spacetelescope/RegressionTests/actions/runs/13039378253
show 1 error test_exec_time_0_crs which I'm chalking up to a slower-than-usual runner which took 11 instead of 10 seconds. I expect these may need to be re-run after review so I'll open this PR for review now.

EDIT: see updated regtests comment: #383 (comment)

Branch protections will need to be updated after this PR is merged to check for pre-commit success.

Tasks

  • update or add relevant tests
  • update relevant docstrings and / or docs/ page
  • Does this PR change any API used downstream? (if not, label with no-changelog-entry-needed)
    • write news fragment(s) in changes/: echo "changed something" > changes/<PR#>.<changetype>.rst (see below for change types)
    • run jwst regression tests with this branch installed ("git+https://github.com/<fork>/stdatamodels@<branch>")
news fragment change types...
  • changes/<PR#>.feature.rst: new feature
  • changes/<PR#>.bugfix.rst: fixes an issue
  • changes/<PR#>.doc.rst: documentation change
  • changes/<PR#>.removal.rst: deprecation or removal of public API
  • changes/<PR#>.misc.rst: infrastructure or miscellaneous change

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 73.12253% with 204 lines in your changes missing coverage. Please review.

Project coverage is 78.17%. Comparing base (788f7bd) to head (0c91732).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
src/stdatamodels/jwst/transforms/models.py 31.70% 84 Missing ⚠️
src/stdatamodels/jwst/datamodels/wcs_ref_models.py 27.08% 35 Missing ⚠️
...tamodels/jwst/transforms/converters/jwst_models.py 67.27% 18 Missing ⚠️
src/stdatamodels/fits_support.py 87.35% 11 Missing ⚠️
src/stdatamodels/model_base.py 87.67% 9 Missing ⚠️
src/stdatamodels/schema.py 85.41% 7 Missing ⚠️
src/stdatamodels/validate.py 50.00% 7 Missing ⚠️
src/stdatamodels/jwst/datamodels/asn.py 37.50% 5 Missing ⚠️
src/stdatamodels/jwst/datamodels/util.py 77.27% 5 Missing ⚠️
src/stdatamodels/properties.py 89.79% 5 Missing ⚠️
... and 9 more
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #383       +/-   ##
===========================================
+ Coverage   67.59%   78.17%   +10.57%     
===========================================
  Files         115      115               
  Lines        5932     5145      -787     
===========================================
+ Hits         4010     4022       +12     
+ Misses       1922     1123      -799     

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

.ruff.toml Show resolved Hide resolved
.ruff.toml Show resolved Hide resolved
.ruff.toml Show resolved Hide resolved
@braingram braingram marked this pull request as ready for review January 30, 2025 19:04
@braingram braingram requested a review from a team as a code owner January 30, 2025 19:04
Copy link
Contributor

@emolter emolter left a comment

Choose a reason for hiding this comment

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

Thanks very much for putting this together, Brett!

The changes to the CI and pre-commit look good to me. I had some suggestions for following up on this PR, but none of them would have to be handled now.

Most of my comments are related to places where I think it wouldn't be overly disruptive to fix the errors instead of noqa: ignore.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.ruff.toml Show resolved Hide resolved
.ruff.toml Show resolved Hide resolved
.ruff.toml Show resolved Hide resolved
.pre-commit-config.yaml Show resolved Hide resolved
src/stdatamodels/jwst/transforms/models.py Show resolved Hide resolved
src/stdatamodels/jwst/transforms/models.py Show resolved Hide resolved
src/stdatamodels/jwst/transforms/models.py Show resolved Hide resolved
src/stdatamodels/model_base.py Show resolved Hide resolved
tests/test_models.py Show resolved Hide resolved
Copy link
Contributor

@emolter emolter left a comment

Choose a reason for hiding this comment

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

I'm happy with this pending passing downstream JWST unit tests. Probably wouldn't hurt to re-run the regression tests too out of an abundance of caution, since you accepted at least one of the "unsafe" fixes I suggested.

@braingram
Copy link
Collaborator Author

@braingram
Copy link
Collaborator Author

Rerunning regtests here: https://github.com/spacetelescope/RegressionTests/actions/runs/13039378253

Regtests show only unrelated errors.

@braingram braingram requested a review from emolter January 31, 2025 22:05
Copy link
Contributor

@emolter emolter left a comment

Choose a reason for hiding this comment

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

Code changes look good to me now, or at least, we have separate issues tracking additional changes.

Why is the Python 3.10 test failing now? I don't see how it was modified by the changes here.

@braingram braingram enabled auto-merge (squash) February 3, 2025 15:05
@braingram
Copy link
Collaborator Author

The 3.10 test failure:
https://github.com/spacetelescope/stdatamodels/actions/runs/13115248313/job/36587914704?pr=383#step:10:282
is one incarnation of the "random" one where depending on the test order (and how CRDS files are downloaded) tests can fail when >1 test downloads the same CRDS file.

@braingram braingram disabled auto-merge February 3, 2025 15:17
@braingram braingram merged commit f7587b7 into spacetelescope:main Feb 3, 2025
19 of 20 checks passed
@braingram braingram deleted the style_checks branch February 3, 2025 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants