Skip to content

Commit 4b6132d

Browse files
authored
Merge pull request #1354 from DimitriPapadopoulos/PIE
STY: Enforce ruff/flake8-pie rules (PIE)
2 parents 7b3c1b2 + 576b74b commit 4b6132d

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

nibabel/ecat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ def to_file_map(self, file_map=None):
957957
hdr.write_to(hdrf)
958958

959959
# Write every frames
960-
for index in range(0, self.header['num_frames']):
960+
for index in range(self.header['num_frames']):
961961
# Move to subheader offset
962962
frame_offset = subheaders._get_frame_offset(index) - 512
963963
imgf.seek(frame_offset)

nibabel/streamlines/tests/test_tractogram.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def make_fake_tractogram(
4949
):
5050
"""Make multiple streamlines according to provided requirements."""
5151
all_streamlines = []
52-
all_data_per_point = defaultdict(lambda: [])
53-
all_data_per_streamline = defaultdict(lambda: [])
52+
all_data_per_point = defaultdict(list)
53+
all_data_per_streamline = defaultdict(list)
5454
for nb_points in list_nb_points:
5555
data = make_fake_streamline(
5656
nb_points, data_per_point_shapes, data_for_streamline_shapes, rng

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ select = [
120120
"C4",
121121
"F",
122122
"I",
123+
"PIE",
123124
"PLE",
124125
"Q",
125126
"RSE",
@@ -140,6 +141,7 @@ ignore = [
140141
"C401",
141142
"C408",
142143
"C416",
144+
"PIE790",
143145
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
144146
"W191",
145147
"E111",

0 commit comments

Comments
 (0)