Skip to content

Commit 11cd3ec

Browse files
committed
lint: ruff as a formatter.
1 parent babfb1f commit 11cd3ec

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ jobs:
4242
pip install -e .[dev]
4343
- name: Linters
4444
run: |
45-
black --check src tests
46-
ruff check .
45+
ruff check src
46+
ruff format --check src
4747
- name: Annotate locations with typos
4848
if: always()
4949
uses: codespell-project/codespell-problem-matcher@v1

src/snake/_meta.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ class ENVCONFIG(metaclass=Singleton):
158158

159159
@classmethod
160160
def __getitem__(cls, key: str) -> Any:
161-
162161
if key in os.environ:
163162
return os.environ[key]
164163
return getattr(cls, key)

src/snake/core/handlers/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
T = TypeVar("T")
1717

18+
1819
@dataclass_transform(kw_only_default=True)
1920
class MetaHandler(MetaDCRegister):
2021
"""MetaClass for Handlers."""

src/snake/core/phantom/shepp_logan.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def mr_shepp_logan(
8282

8383
# Make sure zlims are appropriate
8484
assert len(zlims) == 2, (
85-
"zlims must be a tuple with 2 entries: upper and lower " "bounds!"
85+
"zlims must be a tuple with 2 entries: upper and lower bounds!"
8686
)
8787
assert zlims[0] <= zlims[1], "zlims: lower bound must be first entry!"
8888

@@ -179,7 +179,6 @@ def mr_ellipsoid_parameters() -> np.ndarray:
179179
# Need to subtract some ellipses here...
180180
Eneg = np.zeros(E.shape)
181181
for ii in range(E.shape[0]):
182-
183182
# Ellipsoid geometry
184183
Eneg[ii, :7] = E[ii, :7]
185184

src/snake/core/sampling/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import ismrmrd as mrd
1313

1414

15-
@dataclass_transform(kw_only_default=True) # Required here for pyright to work.
15+
@dataclass_transform(kw_only_default=True) # Required here for pyright to work.
1616
class MetaSampler(MetaDCRegister):
1717
"""MetaClass for Samplers."""
1818

src/snake/toolkit/plotting.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def axis3dcut(
313313
bbox_[i],
314314
bg_cmap=bg_cmap,
315315
z_thresh=z_thresh,
316-
z_max=z_max
316+
z_max=z_max,
317317
)
318318

319319
if cbar:
@@ -324,7 +324,14 @@ def axis3dcut(
324324
im.set_clim(-z_max, z_max)
325325
matplotlib.colorbar.Colorbar(cax, im, orientation="vertical")
326326
cax.set_ylabel("z-scores", labelpad=-20)
327-
cax.set_yticks(np.concatenate([-np.arange(z_thresh, z_max+1, 2), np.arange(z_thresh, z_max+1, 2)]))
327+
cax.set_yticks(
328+
np.concatenate(
329+
[
330+
-np.arange(z_thresh, z_max + 1, 2),
331+
np.arange(z_thresh, z_max + 1, 2),
332+
]
333+
)
334+
)
328335
else:
329336
# use the background image
330337
if vmin_vmax is None:

0 commit comments

Comments
 (0)