-
Notifications
You must be signed in to change notification settings - Fork 0
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
WIP: Ruff #184
base: back-subtract
Are you sure you want to change the base?
WIP: Ruff #184
Conversation
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.
Copilot reviewed 15 out of 30 changed files in this pull request and generated no suggestions.
Files not reviewed (15)
- .github/workflows/black.yml: Language not supported
- .github/workflows/flake8.yml: Language not supported
- chandra_aca/centroid_resid.py: Evaluated as low risk
- chandra_aca/darkbins.py: Evaluated as low risk
- chandra_aca/dark_model.py: Evaluated as low risk
- chandra_aca/attitude.py: Evaluated as low risk
- chandra_aca/tests/test_attitude.py: Evaluated as low risk
- chandra_aca/drift.py: Evaluated as low risk
- chandra_aca/aca_image.py: Evaluated as low risk
- chandra_aca/tests/test_aca_image.py: Evaluated as low risk
- chandra_aca/tests/test_all.py: Evaluated as low risk
- chandra_aca/plot.py: Evaluated as low risk
- chandra_aca/planets.py: Evaluated as low risk
- chandra_aca/tests/test_dark_model.py: Evaluated as low risk
- chandra_aca/star_probs.py: Evaluated as low risk
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.
Looks mostly good, thanks!
frames and not blobs | ||
), "Specify only one of 'frames' or blobs" | ||
# check that only one of blobs or frames is set | ||
if blobs and frames: |
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.
This is not logically equivalent to the original.
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.
Thanks!
@@ -340,7 +341,7 @@ def plot_stars( | |||
r, c = yagzag_to_pixels(zeros, yz_ticks) | |||
ax.set_yticks(c) | |||
ax.set_yticklabels(yz_ticks) | |||
ax.grid() | |||
ax.grid(grid) |
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.
Woohoo, caught a bug!
@@ -1022,22 +1053,22 @@ def guide_count(mags, t_ccd, count_9th=False): | |||
ref_t_ccd = -10.9 | |||
ref_mags0 = (9.0 if count_9th else 9.95) + np.array([0.0, 0.2, 0.3, 0.4]) | |||
ref_mags = {} | |||
for t_ccd in np.unique(t_ccds): | |||
for t in np.unique(t_ccds): |
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.
Avoid single-letter variable names. Instead you could use t_ccd_
.
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.
OK, I used t_ccd_local in the other spot.
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.
In this case t_ccd_unique
would work and be meaningful.
@@ -423,7 +422,7 @@ def test_aca_image_operators(): | |||
def test_flicker_numba(): | |||
a = ACAImage(np.linspace(0, 800, 9).reshape(3, 3)) | |||
a.flicker_init(flicker_mean_time=1000, flicker_scale=1.5, seed=10) | |||
for ii in range(10): | |||
for _ii in range(10): |
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.
_
is the preferred variable for an unused loop parameter. You don't need to bother changing this in test code but keep it in mind for the future.
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.
I think it was the VS code preference to make underscore named throw-away vars - I assume so that they could actually be accessed in test failure.
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.
_
behaves like any other variable to Python and pytest. It is just humans and linters that give it a special meaning.
PS I hadn't asked for review yet until #174 is reviewed and merged. |
Oops, I guess I just got excited. And ruff review is about where I'm at today. |
Description
Ruff
Interface impacts
Testing
Unit tests
Independent check of unit tests by [REVIEWER NAME]
Functional tests
No functional testing.