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

STY: Apply ruff preview rules #1369

Merged
merged 9 commits into from
Oct 2, 2024
Merged

Conversation

DimitriPapadopoulos
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Oct 1, 2024

Codecov Report

Attention: Patch coverage is 81.13208% with 10 lines in your changes missing coverage. Please review.

Project coverage is 95.37%. Comparing base (fa7c248) to head (ec15839).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
nibabel/cmdline/dicomfs.py 0.00% 6 Missing ⚠️
nibabel/ecat.py 0.00% 2 Missing ⚠️
nibabel/freesurfer/io.py 80.00% 1 Missing ⚠️
nibabel/nicom/csareader.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1369   +/-   ##
=======================================
  Coverage   95.37%   95.37%           
=======================================
  Files         207      207           
  Lines       29668    29668           
  Branches     4991     4990    -1     
=======================================
  Hits        28296    28296           
  Misses        932      932           
  Partials      440      440           

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

@@ -699,7 +699,7 @@ def set_zooms(self, zooms):
ndim = dims[0]
zooms = np.asarray(zooms)
if len(zooms) != ndim:
raise HeaderDataError('Expecting %d zoom values for ndim %d' % (ndim, ndim))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just wondering, does ndim really must appear twice in the error message?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's reasonable to say you were expecting N zooms for an N-dim image. I think it would also make sense to rewrite something along the lines of "Zooms must have one value per dimension (ndim={ndim}). Received: {zooms}."

nibabel/tests/test_nifti1.py Show resolved Hide resolved
nibabel/tests/test_round_trip.py Show resolved Hide resolved
nibabel/fileslice.py Outdated Show resolved Hide resolved
nibabel/gifti/util.py Outdated Show resolved Hide resolved
nibabel/nifti1.py Outdated Show resolved Hide resolved
DimitriPapadopoulos and others added 8 commits October 1, 2024 20:40
UP031 Use format specifiers instead of percent format

Co-authored-by: Chris Markiewicz <[email protected]>
FURB145 Prefer `copy` method over slicing
FURB148 `enumerate` index is unused, use `for x in y` instead
FURB157 Verbose expression in `Decimal` constructor
FURB192 Prefer `min` over `sorted()` to compute the minimum value in a sequence
C409 Unnecessary list comprehension passed to `tuple()` (rewrite as a generator)
C419 Unnecessary list comprehension
@effigies effigies merged commit c18f542 into nipy:master Oct 2, 2024
48 of 49 checks passed
@DimitriPapadopoulos DimitriPapadopoulos deleted the preview branch October 3, 2024 17:46
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